# HG changeset patch # User Frank Benoit # Date 1221081242 -7200 # Node ID d994a8b2cdf7a603ecea2e19a0dad50968cb98d3 # Parent ee33f30b14e2e39d1f9bbfaf3adfbc6f26ccd5b0 again compile fixes diff -r ee33f30b14e2 -r d994a8b2cdf7 dsss.conf --- a/dsss.conf Wed Sep 10 22:45:07 2008 +0200 +++ b/dsss.conf Wed Sep 10 23:14:02 2008 +0200 @@ -6,11 +6,11 @@ type=library buildflags+=-Jres -#exclude the incomplete JFace.Text -exclude+=dwtx/text -exclude+=dwtx/jface/contentassist -exclude+=dwtx/jface/text -exclude+=dwtx/jface/internal/text +##exclude the incomplete JFace.Text +#exclude+=dwtx/text +#exclude+=dwtx/jface/contentassist +#exclude+=dwtx/jface/text +#exclude+=dwtx/jface/internal/text version(linux){ buildflags+=-I../dwt-linux diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/draw2d/SWTGraphics.d --- a/dwtx/draw2d/SWTGraphics.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/draw2d/SWTGraphics.d Wed Sep 10 23:14:02 2008 +0200 @@ -310,7 +310,7 @@ if (sharedClipping) { sharedClipping = false; - bool previouslyApplied = (appliedState is currentState.relativeClip); + bool previouslyApplied = (appliedState is cast(Object)currentState.relativeClip); currentState.relativeClip = currentState.relativeClip.getCopy(); if (previouslyApplied) appliedState.relativeClip = currentState.relativeClip; diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/dwtxhelper/Collection.d --- a/dwtx/dwtxhelper/Collection.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/dwtxhelper/Collection.d Wed Sep 10 23:14:02 2008 +0200 @@ -2151,14 +2151,15 @@ } +/ static void sort( T )( T[] a, Comparator c ){ - bool isLess( T o1, T o2 ){ - return c.compare( cast(Object)o1, cast(Object)o2 ) < 0; + static if( is( T : char[] )){ + bool isLess( String o1, String o2 ){ + return c.compare( stringcast(o1), stringcast(o2) ) < 0; + } } - tango.core.Array.sort( a, &isLess ); - } - static void sort( T : String )( String[] a, Comparator c ){ - bool isLess( String o1, String o2 ){ - return c.compare( stringcast(o1), stringcast(o2) ) < 0; + else{ + bool isLess( T o1, T o2 ){ + return c.compare( cast(Object)o1, cast(Object)o2 ) < 0; + } } tango.core.Array.sort( a, &isLess ); } diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/dwtxhelper/PushbackReader.d --- a/dwtx/dwtxhelper/PushbackReader.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/dwtxhelper/PushbackReader.d Wed Sep 10 23:14:02 2008 +0200 @@ -3,9 +3,20 @@ import dwt.dwthelper.utils; class PushbackReader : Reader { + this( Reader reader ){ + implMissing(__FILE__,__LINE__); } void unread( char c ){ + implMissing(__FILE__,__LINE__); } + int read(char[] cbuf, int off, int len){ + implMissing(__FILE__,__LINE__); + return 0; + } + void close(){ + implMissing(__FILE__,__LINE__); + } + } diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/dwtxhelper/StringWriter.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtx/dwtxhelper/StringWriter.d Wed Sep 10 23:14:02 2008 +0200 @@ -0,0 +1,8 @@ +module dwtx.dwtxhelper.StringWriter; + +import dwt.dwthelper.utils; + +class StringWriter : Writer { +} + + diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/contentassist/ISubjectControlContentAssistant.d --- a/dwtx/jface/contentassist/ISubjectControlContentAssistant.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/contentassist/ISubjectControlContentAssistant.d Wed Sep 10 23:14:02 2008 +0200 @@ -12,6 +12,8 @@ *******************************************************************************/ module dwtx.jface.contentassist.ISubjectControlContentAssistant; +import dwtx.jface.contentassist.IContentAssistSubjectControl; + import dwt.dwthelper.utils; import dwtx.jface.text.contentassist.IContentAssistant; diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/internal/text/html/BrowserInformationControl.d --- a/dwtx/jface/internal/text/html/BrowserInformationControl.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/internal/text/html/BrowserInformationControl.d Wed Sep 10 23:14:02 2008 +0200 @@ -32,14 +32,28 @@ pragma( msg, "dwtx.jface.internal.text.html.BrowserInformationControl: SWT browser control missing" ); class BrowserInformationControl : AbstractInformationControl , IInformationControlExtension2, IDelayedInputChangeProvider { - public this(Shell parent, String symbolicFontName, bool resizable){} - public static bool isAvailable(Composite parent){} - public void setInformation(String content) {} + public this(Shell parent, String symbolicFontName, bool resizable){ + super(parent, resizable); + implMissing(__FILE__,__LINE__); + } + public static bool isAvailable(Composite parent){ + implMissing(__FILE__,__LINE__); + return false; + } + public void setInformation(String content) { + implMissing(__FILE__,__LINE__); + } protected void createContent(Composite parent) { + implMissing(__FILE__,__LINE__); } - public void setInput(Object input) {} - public void setDelayedInputChangeListener(IInputChangedListener inputChangeListener) {} + public void setInput(Object input) { + implMissing(__FILE__,__LINE__); + } + public void setDelayedInputChangeListener(IInputChangedListener inputChangeListener) { + implMissing(__FILE__,__LINE__); + } public bool hasContents() { + implMissing(__FILE__,__LINE__); return false; } } diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/text/TextViewer.d --- a/dwtx/jface/text/TextViewer.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/text/TextViewer.d Wed Sep 10 23:14:02 2008 +0200 @@ -4348,8 +4348,8 @@ styledTextPrinter.run(); printer.dispose(); } - Thread printingThread= new Thread( &threadrun ); - printingThread.name = "Printing"; //$NON-NLS-1$ + JThread printingThread= new JThread( &threadrun ); + printingThread.setName( "Printing" ); //$NON-NLS-1$ printingThread.start(); } } diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/text/TextViewerHoverManager.d --- a/dwtx/jface/text/TextViewerHoverManager.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/text/TextViewerHoverManager.d Wed Sep 10 23:14:02 2008 +0200 @@ -278,19 +278,19 @@ return; } - final ITextHover hover= fTextViewer.getTextHover_package(offset, getHoverEventStateMask()); + ITextHover hover= fTextViewer.getTextHover_package(offset, getHoverEventStateMask()); if (hover is null) { setInformation(cast(Object)null, null); return; } - final IRegion region= hover.getHoverRegion(fTextViewer, offset); + IRegion region= hover.getHoverRegion(fTextViewer, offset); if (region is null) { setInformation(cast(Object)null, null); return; } - final Rectangle area= JFaceTextUtil.computeArea(region, fTextViewer); + Rectangle area= JFaceTextUtil.computeArea(region, fTextViewer); if (area is null || area.isEmpty()) { setInformation(cast(Object)null, null); return; @@ -300,59 +300,58 @@ setInformation(cast(Object)null, null); return; } - - void threadrun() { - // http://bugs.eclipse.org/bugs/show_bug.cgi?id=17693 - bool hasFinished= false; - try { - if (fThread !is null) { - Object information; - try { - if ( cast(ITextHoverExtension2)hover ) - information= (cast(ITextHoverExtension2)hover).getHoverInfo2(fTextViewer, region); - else - information= stringcast(hover.getHoverInfo(fTextViewer, region)); - } catch (ArrayIndexOutOfBoundsException x) { - /* - * This code runs in a separate thread which can - * lead to text offsets being out of bounds when - * computing the hover info (see bug 32848). - */ - information= null; - } + fThread= new JThread( dgRunnable( (ITextHover hover_, IRegion region_, Rectangle area_){ + // http://bugs.eclipse.org/bugs/show_bug.cgi?id=17693 + bool hasFinished= false; + try { + if (fThread !is null) { + Object information; + try { + if ( cast(ITextHoverExtension2)hover_ ) + information= (cast(ITextHoverExtension2)hover_).getHoverInfo2(fTextViewer, region_); + else + information= stringcast(hover_.getHoverInfo(fTextViewer, region_)); + } catch (ArrayIndexOutOfBoundsException x) { + /* + * This code runs in a separate thread which can + * lead to text offsets being out of bounds when + * computing the hover info (see bug 32848). + */ + information= null; + } - if ( cast(ITextHoverExtension)hover ) - setCustomInformationControlCreator((cast(ITextHoverExtension) hover).getHoverControlCreator()); - else - setCustomInformationControlCreator(null); + if ( cast(ITextHoverExtension)hover_ ) + setCustomInformationControlCreator((cast(ITextHoverExtension) hover_).getHoverControlCreator()); + else + setCustomInformationControlCreator(null); - setInformation(information, area); - if (information !is null) - fTextHover= hover; - } else { + setInformation(information, area_); + if (information !is null) + fTextHover= hover_; + } else { + setInformation(cast(Object)null, null); + } + hasFinished= true; + } catch (RuntimeException ex) { + String PLUGIN_ID= "dwtx.jface.text"; //$NON-NLS-1$ + ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); + log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, "Unexpected runtime error while computing a text hover", ex)); //$NON-NLS-1$ + } finally { + synchronized (fMutex) { + if (fTextViewer !is null) + fTextViewer.removeTextListener(fStopper); + fThread= null; + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=44756 + if (!hasFinished) setInformation(cast(Object)null, null); - } - hasFinished= true; - } catch (RuntimeException ex) { - String PLUGIN_ID= "dwtx.jface.text"; //$NON-NLS-1$ - ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); - log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, "Unexpected runtime error while computing a text hover", ex)); //$NON-NLS-1$ - } finally { - synchronized (fMutex) { - if (fTextViewer !is null) - fTextViewer.removeTextListener(fStopper); - fThread= null; - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=44756 - if (!hasFinished) - setInformation(cast(Object)null, null); - } } } - fThread= new Thread( &threadrun ); - fThread.name = "Text Viewer Hover Presenter"; //$NON-NLS-1$ + }, hover, region, area ) ); - fThread.isDaemon(true); - fThread.priority(Thread.PRIORITY_MIN); + fThread.setName( "Text Viewer Hover Presenter" ); //$NON-NLS-1$ + + fThread.setDaemon(true); + fThread.setPriority(JThread.MIN_PRIORITY); synchronized (fMutex) { fTextViewer.addTextListener(fStopper); fThread.start(); diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/text/reconciler/AbstractReconciler.d --- a/dwtx/jface/text/reconciler/AbstractReconciler.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/text/reconciler/AbstractReconciler.d Wed Sep 10 23:14:02 2008 +0200 @@ -87,17 +87,17 @@ * @param name the thread's name */ public this(String name) { - thread = new Thread( &run ); - thread.name = name; - thread.priority = Thread.PRIORITY_MIN; - thread.isDaemon(true); + thread = new JThread( &run ); + thread.setName( name ); + thread.setPriority( JThread.MIN_PRIORITY ); + thread.setDaemon(true); } public void start(){ thread.start(); } public bool isAlive(){ - return thread.isRunning(); + return thread.isAlive(); } public JThread getThread(){ return thread; @@ -265,7 +265,7 @@ public void documentChanged(DocumentEvent e) { if (!fThread.isDirty() && fThread.isAlive()) { - if (!fIsAllowedToModifyDocument && Thread.getThis() is fThread.getThread()) + if (!fIsAllowedToModifyDocument && JThread.currentThread() is fThread.getThread()) throw new UnsupportedOperationException("The reconciler thread is not allowed to modify the document"); //$NON-NLS-1$ aboutToBeReconciled(); } @@ -630,6 +630,6 @@ * @since 3.4 */ protected bool isRunningInReconcilerThread() { - return Thread.getThis() is fThread.getThread(); + return JThread.currentThread() is fThread.getThread(); } } diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/text/source/AnnotationModel.d --- a/dwtx/jface/text/source/AnnotationModel.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/text/source/AnnotationModel.d Wed Sep 10 23:14:02 2008 +0200 @@ -736,7 +736,7 @@ removeAnnotations(deleted, false, false); synchronized (getLockObject()) { if (fModelEvent !is null) - (new Thread ( &fireModelChanged )).start(); + (new JThread ( &fireModelChanged )).start(); } } else removeAnnotations(deleted, fireModelChanged_, false); diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/text/source/LineChangeHover.d --- a/dwtx/jface/text/source/LineChangeHover.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/text/source/LineChangeHover.d Wed Sep 10 23:14:02 2008 +0200 @@ -242,7 +242,7 @@ return null; if ( cast(IAnnotationModelExtension)model ) { - IAnnotationModel diffModel= (cast(IAnnotationModelExtension)model).getAnnotationModel(cast(Object)IChangeRulerColumn.QUICK_DIFF_MODEL_ID); + IAnnotationModel diffModel= (cast(IAnnotationModelExtension)model).getAnnotationModel(stringcast(IChangeRulerColumn.QUICK_DIFF_MODEL_ID)); if (diffModel !is null) model= diffModel; } diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/text/source/projection/ProjectionSummary.d --- a/dwtx/jface/text/source/projection/ProjectionSummary.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/text/source/projection/ProjectionSummary.d Wed Sep 10 23:14:02 2008 +0200 @@ -62,9 +62,9 @@ * Creates a new thread. */ public this() { - thread = new Thread( &run ); + thread = new JThread( &run ); fProgressMonitor= new NullProgressMonitor(); // might be given by client in the future - thread.isDaemon(true); + thread.setDaemon(true); thread.start(); } diff -r ee33f30b14e2 -r d994a8b2cdf7 dwtx/jface/text/templates/TemplateTranslator.d --- a/dwtx/jface/text/templates/TemplateTranslator.d Wed Sep 10 22:45:07 2008 +0200 +++ b/dwtx/jface/text/templates/TemplateTranslator.d Wed Sep 10 23:14:02 2008 +0200 @@ -135,7 +135,7 @@ return; if (fType is null) fType= type; - if (!type.equals(fType)) + if (!type.opEquals(fType)) fail(TextTemplateMessages.getFormattedString("TemplateTranslator.error.incompatible.type", stringcast(fName))); //$NON-NLS-1$ } }