FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Status Report
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> DWT
View previous topic :: View next topic  
Author Message
Shawn Liu



Joined: 09 Mar 2005
Posts: 104
Location: Shanghai, China

PostPosted: Sun Apr 17, 2005 12:12 am    Post subject: Status Report Reply with quote

Status Report :

Note: "ported" only means they can pass compiling and linking but functional is not guaranteed.

20050417
accessibility folder partially ported, many functions commented.
custom folder ported,
events folder ported,
graphics folder ported, load image form *.res capability added.
internal folder ported
internal.image folder, only winbmp,winicon file ported
layout folder ported
printing folder ported, but print dialog refuse to work
util folder, vector and hash added for smooth porting java codes
widgets folder ported, not fully tested yet

under construction folders :
browser, dnd, internal.image, internal.ole, ole, program


Download url
http://www.dnaic.com/d/download/
source code : http://www.dnaic.com/d/download/dwt-20050506.rar
binary sample : http://www.dnaic.com/d/download/dummyeclipse.exe
screenshot : http://www.dnaic.com/d/img/dummyeclipse.png

We need make some more samples to debug our codes. I think currently what we need to do is to get rid of bugs, and make DWT usable. Not only port all SWT files.

Shawn


Last edited by Shawn Liu on Sat May 21, 2005 8:44 am; edited 1 time in total
Back to top
View user's profile Send private message
Shawn Liu



Joined: 09 Mar 2005
Posts: 104
Location: Shanghai, China

PostPosted: Sun Apr 17, 2005 12:29 am    Post subject: Reply with quote

I tried to upload the file to SVN server but failed. The server is very slow and the connection is very poor. Sad
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 17, 2005 11:49 pm    Post subject: Reply with quote

Woah! Very impressive, Shawn.

I didn't realize you had made such progress. I'll investigate this as I can.
Amazing that you have a sample DWT app running.

The connection to your server is very slow, so I can imagine you had troubles connecting to svn from there. Maybe Brad can merge your DWT source in for you.

Once again, great work!

(I'm really getting desperate; having no laptop is killing me Sad )

-JJR
Back to top
View user's profile Send private message
Shawn Liu



Joined: 09 Mar 2005
Posts: 104
Location: Shanghai, China

PostPosted: Mon Apr 18, 2005 8:37 am    Post subject: Reply with quote

Hi, John:
Thanks for your response.

The server where I placed the file is a family PC of my colleague. AMD Athlon2600+ powered by Gentoo Linux. I can visit it smoothly since we both located in Shanghai CN. To visit it from US or CA maybe very slow. I can image that because I can hardly connect dsource SVN server smoothly. Use download tool such as NetAnt Flashget may help.
The DWT project is too big. Development and maintance are not easy. I encountered many problems while porting and there are still a lot can't be located. The most headache is "Access Violation" error, compare Object "!=" or "!==" sometime cause "Access Violation", access a null Object, a function forget to return value and etc .... These are runtime errors with no prompt while compiling but just make the app crash.

I think DMD still need too much promote. It should check the function return value absent or a switch block without a ''default" segment and give some prompt when compiling.
But actually, the DMD is improving step by step. With DMD v0.119 I encounter a forward reference error and tried so many times and adjusted the imports but failed. While it compiled Okay by DMD v0.120 with nothing changed.


I am currently focused on Unicode version build and thinking of integrate delegate into DWT to replace the SWT listeners. Because D can't support anonymous class, it is very inconvenient when I make the example. You have to inherit many listener classes but those classes can't access your main class's member, you must introduce the main class object into the listener class. Too inconvenient. A delegate way should be implemented and I have found a little hint so far.

Hope you can back to project soon. The IMAGE, OLE and DND folders are not ported and I am not familiar with COM programming. These files are simply replaced some code with regular expression from java way to D.

And I think the Linux version of DWT may be concerned. I have no experience of Linux programming say nothing of GTK Motif. Actually I seldom use Linux. But I am interested.

May be we can invite some volunteers to DWT team since the project is too big.

Just some thing in my mind. May be concerned later.


Shawn
Back to top
View user's profile Send private message
Shawn Liu



Joined: 09 Mar 2005
Posts: 104
Location: Shanghai, China

PostPosted: Wed May 04, 2005 10:00 am    Post subject: Delegates integrated into DWT Reply with quote

I have delegates integrated into DWT. The original Listener/Event mechanism is kept. The method addXXXListener() still can be used.

There are 3 ways to add a delegate to a widget.

Code:

void handleEvent(Object cData, int eventType, delegate());
void handleEvent(Object cData, int eventType, delegete(Event e));
void handleXXX(Object, delegate(XXXEvent e));
// XXX is an Event Type, e.g.
void handleSelection(Object cData, delegate(SelectionEvent e));
void handleMouseUp(Object cData, delegate(MouseEvent e));

// example
Shell shell = new Shell(display);
Button btn1 = new Button(shell, DWT.Push);
Button btn2 = new Button(shell, DWT.Push);
Button btn3 = new Button(shell, DWT.Push);
Button btn4 = new Button(shell, DWT.Push);
Button btn5 = new Button(shell, DWT.Push);

// anonymous delegate
btn1.handleEvent(shell, DWT.Selection, delegate() {   
   writefln("I am an anonymous delegate with no parameters");
});
btn2.handleEvent(shell, DWT.Selection, delegate(Event e) {
   Shell shell = cast(Shell)e.cData;
   // do something with the shell
});
btn3.handleSelection(btn1, delegate(SelectionEvent e) {
   Button btn = cast(Button)e.cData;
   btn.setEnabled(false);
   writefln("I am a TypedDelegate with a TypedEvent parameter);
});

// named delegate
// null can be passed
btn4.handleSelection(null, onBtn4Clicked);
btn45handleSelection(btn5, onBtn5Clicked);
shell.handleEvent(shell, DWT.Dispose, onShellDisposed);

void onBtn4Clicked() {
   writefln("Btn4Clicked");
}
void onBtn5Clicked(Event e) {
   Button btn = cast(Button)e.cData;
   btn.setText("I am btn5");
   writefln("Btn5Clicked");
}
void onShellDisposed(DisposeEvent e){
   Shell shell = cast(Shell)e.cData;
   // release the resources used by the shell
}

// General Delegate and Typed Delegates
public alias void delegate()            GeneralDelegate;
public alias void delegate(ArmEvent)          ArmDelegate;
public alias void delegate(ControlEvent)       ControlDelegate;
public alias void delegate(DisposeEvent)       DisposeDelegate;
public alias void delegate(Event)         EventDelegate;
public alias void delegate(FocusEvent)          FocusDelegate;
public alias void delegate(HelpEvent)          HelpDelegate;
public alias void delegate(KeyEvent)          KeyDelegate;
public alias void delegate(MenuEvent)          MenuDelegate;
public alias void delegate(ModifyEvent)       ModifyDelegate;
public alias void delegate(MouseEvent)          MouseDelegate;
public alias void delegate(PaintEvent)          PaintDelegate;
public alias void delegate(SelectionEvent)       SelectionDelegate;
public alias void delegate(ShellEvent)          ShellDelegate;
public alias void delegate(TraverseEvent)      TraverseDelegate;
public alias void delegate(TreeEvent)          TreeDelegate;
public alias void delegate(VerifyEvent)         VerifyDelegate;


Last edited by Shawn Liu on Wed May 25, 2005 8:17 am; edited 1 time in total
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 04, 2005 1:34 pm    Post subject: Reply with quote

Great!

I'm back in business again (Laptop is now operational).

Is there anything in DWT that you need help with? I got a little distracted with another project and almost forgot about DWT! Embarassed

Has svn been updated with the changes yet?

-JJR
Back to top
View user's profile Send private message
Shawn Liu



Joined: 09 Mar 2005
Posts: 104
Location: Shanghai, China

PostPosted: Thu May 05, 2005 12:49 pm    Post subject: Reply with quote

The svn hasn't been updated yet. I am struggling with "Access Violation" errors. It almost made me crazy.

The "Access Violation" is the most runtime error and is not easy to fix.
Maybe we have to wait for a upgrade of DMD. But when compiled with DMD v0.122 I got a "circular inheritance of interface" error. It seems that it is a bug introduced in dmd 0.122.
Hope the fix will come soon.


- Shawn
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Thu May 05, 2005 1:02 pm    Post subject: Reply with quote

Shawn Liu wrote:
The svn hasn't been updated yet. I am struggling with "Access Violation" errors. It almost made me crazy.


I know what you mean! I've come across that error far too often in D projects. It's very annoying and difficult to troubleshoot. Are you using windbg on your executables?

Shawn Liu wrote:
The "Access Violation" is the most runtime error and is not easy to fix. Maybe we have to wait for a upgrade of DMD. But when compiled with DMD v0.122 I got a "circular inheritance of interface" error. It seems that it is a bug introduced in dmd 0.122.
Hope the fix will come soon.


I saw some posts about that on the newsgroup. I'm sticking to 0.121 until I know that the issue has been resolved. This wait and see technique is one of the reasons DWT stalled for so long before being continued. Dmd was very slow in resolving some of the issues.

I guess we just do what we can as we can.

-JJR
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Thu May 05, 2005 1:05 pm    Post subject: Reply with quote

I'll try downloading from your site again. Perhaps I can get further this time. If I succeed in get the source, maybe I can update the svn.

In the past, I've only been able to get halfway through downloads before it quits. And it's very slow.

-JJR
Back to top
View user's profile Send private message
Shawn Liu



Joined: 09 Mar 2005
Posts: 104
Location: Shanghai, China

PostPosted: Sat May 21, 2005 8:41 am    Post subject: New implementation Reply with quote

After several attempts, I think keep DWT source file more SWT like is helpful.
For example:

1. struct: implements Win32 struct as class like SWT goes
2. arrays: using SWT way of System.arraycopy() instead of D dynamic arrays
3. TCHAR: kept the SWT TCHAR implementation
4. Pointer: no char*, int* like style in DWT, SWT HeapAlloc() instead
5. version: dynamic detect Unicode/Ansi like SWT does, use -verion=Ansi force Ansi version
6. module: swt.???.?? module name used instead of dwt.??? and constant is SWT.CONSTANT. This is for convenience. Since we may need check java and d files, copy swt code to dwt, and port swt java examples to D, it is very annoying to change those symbols.
and more ....

In this way, we can check D file against java file easier, and take the advantage of tracing the update/fix of SWT, and avoid introduce new bugs to the porting.

I have started the new plan for some time and achievement expected soon.

- Shawn Liu
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun May 22, 2005 11:10 am    Post subject: Reply with quote

All points sound good, Shawn. As you suggest, I think it is best to stick as close to the original SWT implementation as possible to accomodate SWT version tracking. This important point was discussed in another topic.

If the task of automating the updates could be performed, that would be even better. There was another project working to this purpose.

-JJR
Back to top
View user's profile Send private message
Shawn Liu



Joined: 09 Mar 2005
Posts: 104
Location: Shanghai, China

PostPosted: Wed May 25, 2005 8:39 am    Post subject: Reply with quote

Current Problems

I list current problems here, Hope we can solve them.

1. workable with blemish
1) Some control's initial background is not correct. e.g. Label, Scale, check/radio button
2) Combo: both appearance and behavior are strange. But its style is identical to SWT app. (Detected with spy)
3) Edit: the vertical scrollbar shown not synchronized with contents. It appeared even if only two lines.
4) Table/TreeTable: Header missing.
5) CCombo: arrow width/height seems like flipped
2. StyledText is not finished yet. I got some 4invalid UTF error.
3. COM/OLE can not work currently. This will cause some other thing refuse work, such as "Accessible", "Drag and Drop", "Browser", "Clipboard".
Some code of Accessible is commented currently. see accessible.d line77, this leads to CCombo failed when addAccessilbleListener().
I think this may be involved in the implementation of array based callback.
4. JPEG, GIF, PNG image is not workable. This is more easier.
5. Make DWT library Problem.
The dwt.lib can be make with pagesize=128. But when I link with it, the linker complains that all the template based classes and methods are missing.


- shawn
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 25, 2005 9:01 am    Post subject: Reply with quote

Shawn,

I wonder how many of these issues are also due to bugs in SWT? Perhaps it's important to have a automated means of tracking the latest SWT version so that we don't have fix bugs that are not related to D.

Kris is working on a tool that's supposed to do this for SWT. Maybe we can consider working with him on this? You've brought DWT incredibly far as it is. Maybe we can take it to the next step be teaming up with him.

Concerning the problem with creating a library containing templates, this is a known issue that was discussed on the d newsgroup about a week or more ago. It is a problem with the OMF format in general and the library archiving system in particular. There is a fairly simple workaround for this. I'll try to make a library also and see if I can correct this. I had the exact same problem while working on Antonio's DUI.

In the meantime, maybe you would like to read the newsgroup posting on the matter:

See "Hair-pulling, D, and optlink" on the digitalmars.d newsgroup.

I don't know how to find the link to it... sorry. Sad

-JJR
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Wed May 25, 2005 9:16 am    Post subject: "Hair-pulling, D, and optlink" Reply with quote

I guess you mean this: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/23701

Quote:
The problem is that when templates are instantiated, they are inserted into an object file record called a COMDAT. COMDATs have the necessary feature that if multiple object files have a COMDAT with the same name, the duplicates are discarded.

This feature is necessary for template instantiations, since the compiler compiling one module doesn't know about the same templates being instantiated by another module.

An unfortunate side effect is that the one cannot pull object files out of a library by referencing COMDATs alone, one must reference something else in that object file, too.

The dmdscript.lib library has the same problem with protoerror.d. I solved it with the kludge of inserting:

Code:
    int foo;


into the file, and then referencing it in dobject.d with:

Code:
    int* pfoo = &dmdscript.protoerror.foo;


Not too pretty, but it works.
Back to top
View user's profile Send private message AIM Address
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed May 25, 2005 9:25 am    Post subject: Reply with quote

Bleah! I should have known who to call! Smile

How do you search that site? I can't seem to bring up the links properly?

Thanks, Justin. Much appreciated!

-JJR
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> DWT All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group