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

GTK and Windows versions
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
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Mon Mar 08, 2004 10:11 pm    Post subject: GTK and Windows versions Reply with quote

JJR wrote:
swt-pisrc.zip


ah! there it is!

so now we can compare the 2 versions:
(*.java files only)
7 files specific to GTK
2 files spedific to Windows
70 files different on GTK --- Windows
206 files identical on GTK --- Windows

the different files are all on the packages:
accessibility (1)
awt (1)
browser (1)
dnd (11)
graphics (11)
internal (2)
printing (2)
programs (1)
widgets (40)

(adds up to about 70)

probably some will have a lot of changes, some just a few.
but for consistency all those 70 should be like Andy's dfbth
Code:

Code:
module dfbth.button;

public:

version (dfbthWin32)
{
    import dfbth.win32.button;
}
version (dfbthGtk)
{
    import dfbth.gtk.button;
}



What do you think?

And I think that could be the next thing to do so that
we have only one source tree.

let me know, I might do that tomorrow (unless you guys
have a better idea).

Ant
Back to top
View user's profile Send private message
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Mon Mar 08, 2004 11:03 pm    Post subject: Reply with quote

This sounds okay, but I think that all of the widgets should be implemented the same (maybe we're saying the same thing). Aren't the main differences in internal? Those seem to be the calls to the native methods on each platform. os.d has most of them for Win32. I am surprised to see the 40 different files in Widgets, but I haven't looked through the linux files yet. I hope that's where there are few differences, and most of the differences are in internal and graphics. Am I making sense? I thought that SWT abstracts its way up from internal (native calls) all the way up through graphics, and then to very generalized widgets.

My point is that I agree with you on making them consistent with Andy's lib, but I am assuming (maybe incorrectly) that SWT already did that. Calling button in SWT should do the appropriate native call in internal/xxx/os - I could be wrong.

Ant, I wouldn't discourage you from going off in a direction for a little while. If it seems worthwhile, keep going and we'll take a look at what you've done.
_________________
I really like the vest!
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Mon Mar 08, 2004 11:56 pm    Post subject: Reply with quote

brad wrote:
Aren't the main differences in internal?


You're right.
I used diff -rqs that seems to report only when
the directories match.

diff -rqsN shows all the files on the directories that
don't have correspondence on both versions.
(i.e. directories that exist on only one of the versions)

that doesn't invalidate the fact that only 70 files are different
on both systems. but now there are another 230 files
that are specific to one system or the other.

I guess we can still consider one source tree
and omit the irrelevant directories on the make files.

Tomorrow I'll try to do if it still sounds like a good idea.

here are my diff and greps:
Code:
#!/bin/sh

# diff compares all files
diff -rqsN ../../swt ../../swtWIN > differences

# extract files specific to windows version
grep "Only in" differences | grep swtWIN > swtOnlyWIN

# extract files specific to GTK version
grep "Only in" differences | grep -v swtWIN > swtOnlyGTK

# extract files different on both version
grep "differ" differences > swtDifferent

# extract files that are the same on both version
grep "are identical" differences > swtEqual

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



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Tue Mar 09, 2004 12:05 am    Post subject: Reply with quote

Ok, it's finally dawned on me....

I think what he's saying is that there are plenty of differences outside of the internal directory contrary to what we thought. If that's the case, I'm kind of stumped as to why SWT is supposed to be so great... Let me think this through...

70 differences in the high level interface is not what I expected for a toolkit that's supposed to hide the OS differences in the name of portability. But then I suppose most of those differences are not visibile to most of the programs using the toolkit. So portability is not in this kit, but in the software designed to use the kits features. I can see why this kit was especailly useful for Java which has much lower risk of implementing platform specific code in the applications that use the kit (because of the VM). D programmers will be more prone to make non-portable dwt applications, I think.

In SWT, widgets may be implemented differently per platform (and the internal OS functionality basically allows the toolkit to organize those differences clearly and properly); but beyond that, each widget still has to be set up in this kit fairly specificly per operating system. It appears Ant was right afterall.

I guess it should have been obvious when we saw that the kit was supplied in two completely different zip files for gtk and win32.

The portability is in the apps using the kit, not the kit itself:

In apps using the kit, we can make common calls on win32 and linux to say:

widget1.setKeyState(data);

Both OS's share the same call... but this call is implemented slightly differently on linux and win32 (just an example) because they may take more or fewer OS calls to do the same thing internally.

So basically we haven't a huge advantage with porting SWT other than these reasons:

1) it's a popular and proven kit
2) the design is already laid out for us
3) it implements native widget interface for each OS
4) the cross-platform organization and details have already been worked out, for the most part in the source.

Though not impossible, it will be a challenge to integrate versioning information throughout the kit. Perhaps Ant is right about separating the two. Otherwise porting is porting. So I guess we have our work cut out for us. Ah heck, it'll be a good project anyway. It's funny, though, that none of this occurred to me until now.

Thanks, Ant, for bringing up the subject.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Tue Mar 09, 2004 4:46 pm    Post subject: Reply with quote

Now I realize the widget.setKeyState() method was not a very good example (since it's probably a very simple non-OS dependent call), but hopefully you get my point.
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Tue Mar 09, 2004 5:11 pm    Post subject: Reply with quote

JJR wrote:
Ok, it's finally dawned on me....
Though not impossible, it will be a challenge to integrate versioning information throughout the kit. Perhaps Ant is right about separating the two. Otherwise porting is porting. So I guess we have our work cut out for us. Ah heck, it'll be a good project anyway. It's funny, though, that none of this occurred to me until now.

Thanks, Ant, for bringing up the subject.


Evil or Very Mad My answer to this never made it to the group!!!!!

I said:
- it's not as bad as you make it look like
- I believe it's better to have one source tree only
- maintaining 70 files with
Code:
version(windows) import windows.file;
version(linux) import linux.file;

will not be a burden at all
- maybe the original SWT team has only one source code tree
that is splited just for publishing
- we could enforce a the common API to both systems (if necessary)

I didn't get to do the win/linux source tree merge yet.
but I believe it's the way to go.

the differences on the source tree will be managed on the
makefiles.

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



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Tue Mar 09, 2004 5:51 pm    Post subject: Reply with quote

Ant,

Vascillating is my specialty Confused

I very likely got carried away with my pessimism. You are right that we probably can integrate the two versions into a common source. I was just a little distraught to find out the differences weren't just localized to the "internal" packages as I originally thought.

As long as we have a game plan, things should go fine... Smile

Later,

John
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Wed Mar 10, 2004 7:02 pm    Post subject: Reply with quote

JJR wrote:
we probably can integrate the two versions into a common source.


How about

graphics
graphics/versionWin32
graphics/versionLinux
widgets/
widgets/versionWin32
widgets/versionLinux
...
?

Ant
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Wed Mar 10, 2004 7:12 pm    Post subject: Reply with quote

Ant wrote:
JJR wrote:
we probably can integrate the two versions into a common source.


How about

graphics
graphics/versionWin32
graphics/versionLinux
widgets/
widgets/versionWin32
widgets/versionLinux
...
?

Ant


actually to conforme with D less the optimal standards
and avoid any remote possibility of confusion with the
exsiting packages on SWT:

graphics
graphics/versionwindows
graphics/versionlinux
widgets/
widgets/versionwinwindows
widgets/versionlinux

Ant
Back to top
View user's profile Send private message
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Wed Mar 10, 2004 7:17 pm    Post subject: Reply with quote

Yep... just like internal is already set up. I think this will work. Ant, are you making any progress at all? I'm bummed because work is extremely busy. I was hoping to have time this week to work with you because you're on vacation, but it was not to be. Sad
_________________
I really like the vest!
Back to top
View user's profile Send private message
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Wed Mar 10, 2004 8:39 pm    Post subject: Reply with quote

On Friday I get a new laptop and I'll make it dual boot to XP and Gentoo linux. I can then switch back and forth to do DWT development. Very Happy
_________________
I really like the vest!
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed Mar 10, 2004 9:05 pm    Post subject: Reply with quote

Ant,

Quote:
actually to conforme with D less the optimal standards
and avoid any remote possibility of confusion with the
exsiting packages on SWT:

graphics
graphics/versionwindows
graphics/versionlinux
widgets/
widgets/versionwinwindows
widgets/versionlinux


I don't quite understand. This looks like a rather bulky way to reference things. Can't we just do version(windows) and version(linux) within each source file for the necessary changes? Then it's all integrated. Or are you suggesting that it's better to completely separate the two d source files so that we have a clearer separation of the 2 OS ports.

Brad,

What laptop are you getting and what Linux distribution are you going to install on it? I've got my new laptop currently dual booting to Windows XP and Gentoo Linux with a 2.6.1 kernel (with Gnome 2.4.2). My laptop is a Compaq Presario X1050ca with a wide screen Smile. I love laptops!

Later,

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



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Wed Mar 10, 2004 9:16 pm    Post subject: Reply with quote

I'm hoping to be more involved in this project at the end of this month. My courses should be done by then.
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Wed Mar 10, 2004 9:40 pm    Post subject: Reply with quote

JJR wrote:
I don't quite understand. This looks like a rather bulky way to reference things. Can't we just do version(windows) and version(linux) within each source file for the necessary changes? Then it's all integrated.


The differences are too big to go with your idea.

JJR wrote:
Or are you suggesting that it's better to completely separate the two d source files so that we have a clearer separation of the 2 OS ports.


yes,
This way we have only one source tree but it will be easier
to work on each version.

so, is it 2 against 1? :)

Ant
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Wed Mar 10, 2004 9:47 pm    Post subject: Reply with quote

brad wrote:
Yep... just like internal is already set up. I think this will work. Ant, are you making any progress at all?


I'm about to start merging the linux files into the main tree.
is it official that we are callin it linux not gtk?
I guess that will have better acceptance by potencial users.

I'm taking it easy... Cool

brad wrote:
I'm bummed because work is extremely busy. I was hoping to have time this week to work with you because you're on vacation, but it was not to be. Sad


don't over do it... Wink

How did you make the selection of modules that exist on the current source tree?
Is this the minimum set to have a window popuing up?
Did you use any import depencency tool?

Ant
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