When Google released its Chrome web browser not too long ago, it of course emphasised that the browser was an open source product. The browser contains 24 parts originating from 3rd parties, and to some surprise, one of those parts comes from one of Google’s biggest enemies – Microsoft.
Scott Hanselman dove into Chromium’s source code, and found out what Microsoft open source code is tucked away, deep inside the warmly welcomed browser. As it turns out, Google’s Chrome makes use of the WTL, the Windows Template Library, which was released as open source in 2004. WTL is licensed under the MS-PL, which is more or less Microsoft’s equivalent of the MIT license. What is WTL?
WTL is a C++ library for Win32 development and is kind of like MFC (Microsoft Foundation Classes), but a lot more lightweight. WTL embraces ATL (Active Template Library) which is a series of C++ template classes made to make COM development easier. It was more or less patterned after the STL (Standard Template Library).
May 2004 is a long time ago in Computerland (heck, John Kerry still thought he would become the next president of the United States), and as it turns out, the Windows Template Library was one of the first open source Microsoft projects.
[WTL] was one of the first if not the first OSS things from Microsoft and it was a tough sell. There was a meeting with some bosses where we were presenting 3 potential OSS items. I guess it was the first “real OSS” with joint MS/Community involvement as opposed to just us posting something externally. WTL was the only one that got approved.
It’s always interesting to see open source at work. Hanselman’s article is an interesting read, as it takes a closer look at how, exactly, the WTL code is being used by Chrome.
They wanted to open source it anyway and with Qt we would be using Linux and Mac versions right now.
No you wouldn’t. Google has stated that they want to offer fully native versions for each platform, and Qt, while a very good platform, is NOT native to Windows and OS X.
It’s a shame that they couldn’t make it look native then.
either way doesn’t Qt use the native widgets in windows and osx? They could have done just the ui using qt instead of implementing their own.
Edited 2008-09-16 14:30 UTC
QT uses native widgets in Windows and OSX so QT applications feel native in those environments.
Opera doesn’t. It’s UI is a disaster on OS X.
QT is anything-but “native”.
But opera doesn’t try to be native on any platform. In linux, even using KDE it feels out of place. I refer to applications like Skype for example (although I don’t know how it looks on OSX, it seems native on Windows).
Skype uses QT only on Linux, On the Mac is uses Cocoa. You can find this out by looking at the exported names from the binary, only Cocoa and standard C names are used. It does not link or use QT in any way on the Mac.
.
Same with tons of other applications, such as Mathematica which uses QT on Linux, Carbon on Mac and the standard GDI functions on Windows.
A lot of people seem to think that if an app uses QT on Linux, it uses QT on all other platforms.
One of big problems with QT is that non Mac users have no idea how terrible QT applications look and behave on the Mac.
Edited 2008-09-16 16:08 UTC
“how terrible”, “God awful” – what is that – technical evaluation of problem domain?
I really don’t know, what is so terrible with apps looking differently. In fact, with REBOL, I prefer non native widgets. I even think, it is some kind of advantage – to be different, while preserve the same app across the platforms. More so nowadays, in the internet app era, when ppl are more forgiving.
What is important imo is not look, but proper (system compatible) app behavior on certain platforms ….
You should have worked at Sun’s PR. “Java Swing is ugly, but it’s equally ugly on all platforms. Give us credit for consistency!”
I think that your post is nearly not worth replying to. I occupy respected IT possition and don’t need to be taught where should I work and what should I say. So please stop talking crap and start to actually use some arguments.
Who said cross platform toolkit has to look ugly? What if something like that looks quite cool? And is consistent too? Then what?
You sound like OS fanatic fanboy, who thinks that “native” is always consistent. Well then, what about Office 2007 and Microsoft with tonnes of their UI experts?
Who says Swing is ugly? That might have been true three or four years ago but Swing produces attractive GUI’s now. Due to the “lowest common denominator” syndrom it can be difficult to program, especially the non-thread-safe aspect, but I find the produced GUI appealing.
That’s funny because Opera only uses Qt on Linux, and there only in a very limited sense (mostly for stuff like printing). They actually have their own cross-platform toolkit called Swift if I remember correctly.
Actually QT doesn’t really use native widgets, it sort of does, but not really. Take a look through the source code, QT handles all of its own messaging and most if its own drawing. Essentially, each widget is connected to something like a peer, kind of like Java Swing. It is horribly complex.
Thats the reason why QT applications look absolutely God awful on the Mac and usually pretty bad on Windows (especially when compared with a true native WPF app on Windows or a Cocoa app on OSX).
And yes, I know that there is a beta version of QT that uses Cocoa, but I took a look at the source, and it does the exact same thing. It still most of its own drawing, it just draws to a Cocoa window instead of a Carbon window.
There is a reason why Apple ditched the bottom end of WebKit which was QT to a very light platform abstraction layer. There is a reason why most decent cross platform applications use the real native toolkit on each platform and not some library like QT. QT is really only truly native on Unix where QT and GTK ARE the toolkits.
Edited 2008-09-16 15:56 UTC
wouldn’t it be nice if QT developers learned to deligate the drawing to the native widgets?
Cross platform native apps are hard. The code to handle it will be complex. You won’t find any toolkit that can do what Qt can and is any simpler.
I don’t use Qt on OS X, but on Windows they are pretty much indistinguishable. Especially considering every single windows app looks slightly different, so there really is no “native” windows look. Office, WMP, Explorer, Notepad, etc all look different, and those are from the same company. I haven’t received any complaints about my Qt software on windows from any clients.
If you talk to normal users (not computer geeks) you will realize that no one gives a crap about what happens under the hood. However Qt does come with a lot more features, and since Chrome was supposed to be as lightweight as possible, I suspect that google went with something customized to keep down on overhead. It’s more of a tech demo anyway, I don’t think anyone seriously believes that Chrome will be a major browser.
Edited 2008-09-16 18:22 UTC
Speak for yourself. Chrome is very likely to be a “major browser”. Firefox garnered much of its popularity riding on the coattails (and pocketbook) of Google. Remember all those years Mozilla/Firefox sat at low single digit market share?
Yes, Firefox has finally clawed some market share from IE, after so many years and years. And Firefox has nothing but advantages over IE. Better standards support, faster, better adblocker, better safety, better extensions (mostly adblock and flashblock for the normal user), it’s open source, and works on all platforms.
I can easily make the argument to switch from IE to Firefox, but to Chrome? It’s open source sure, and its faster, and it has a couple nifty features.. But it’s windows only (for now), it uses more RAM (by design, and this is crucial for many people who are still running $199 computers with 256MB of RAM), it doesn’t have a good adblocker, and no extensions.
So why would anyone switch? Don’t get me wrong, Chrome is pretty neat, I really like some parts of it, but I can’t see any real advantages over Firefox for the average Joe, while Firefox has many advantages of its own. Chrome is speedy, but in real life, you won’t see that much of a difference, and every browser is getting faster there too.
It’s much more likely that other browsers will absorb Chrome’s ideas..
Oh yes, the speed does make a difference in “real life”.
The overall speed, simplicity, and responsiveness make Chrome a pleasure to use, and this is something techies often underestimate. You don’t need a plethora of new features to make good software. Google has the outreach to make people give it a try, and Chrome has the quality to make them want to stick with it.
Erm… WPF is not “native” by your definition either. WPF handles all of it’s own drawing, and builds it’s own messaging system on top of Windows’s events. Just like Qt.
Windows.Forms does this as well. So do the UI libraries used internally by Microsoft’s various applications. So does Internet Explorer. So does Firefox.
QT3 used native widgets but QT4 does NOT!
That’s interesting. I always thought native just meant it was compiled for that OS and now Wine type layer was in use. If not using native widgit’s means it’s not native doesn’t that mean Google Chrome, Nero, WMP11, etc are not native either?
“Native” is one of my most hated words. The best thing is not to use it and say what you mean instead.
So what? that’ll be using Xlib on Unix platforms then?
Er, yes it is. If its not native on windows, then its not native on Linux, OSX or any other OS either.
or Linux? QT is not native to Windows, OS X or Linux. From the way you use the word. Linux also qualifies. I’m not saying thats what you meant but thats what it sounds like to me. What do people mean when they say native anyway?
Making it with Qt would abligate Google to release it under the GPL, and it is abvious the didn’t want that, They could have a Qt license an release it under the license they want it but anyone who wanted to contribute would have to buy a Qt license too. So please, stop the Qt non sense. Is to limitant.
No, since version 4.X (X is something I don’t remember) QT license has an exception for open source projects so basically, if your project is open source, then you can use QT for free and apply to your sources the license you like.
If that were the case people would have applied the LPGL license to their projects, but they can’t, The Qt 4.x license is just to make it a litle more complatible (in other words leech code) to other license like Apache and Eclipse.
Edited 2008-09-16 16:16 UTC
The details of that arrangement, well hidden-away, are at http://doc.trolltech.com/4.4/license-gpl-exceptions.html
From Chrome source http://src.chromium.org/viewvc/chrome/trunk/src/sandbox/src/dep.cc?…
// Completely undocumented from Microsoft. You can find this information by
// disassembling Vista’s SP1 kernel32.dll with your favorite disassembler.
enum PROCESS_INFORMATION_CLASS {
ProcessExecuteFlags = 0x22,
}
There is Java and there is Lobo. And once upon a time there was HotJava. If they wnted to innovate they could sta HotGoogle. Otherwise I stay with my very native Kmeleon/Epiphany/Konqueror and Seamonkey/FFox.
Uh, so what?
Isn’t this what Open Source is supposed to be about?
Anyone can modify and reuse it.
There’s no clause to say “* except competitors”.
This is not news, it’s flame-bait.
It’s interesting. Click the read more, and read the last line.
It was interesting maybe in 2004, when Microsoft released it but there is nothing ‘magical’ about Microsoft’s code.
Open source code is used everywhere, up and down the web, every day. Trying to paint WTL in Chrome as some kind of unholy matrimony is just pandering to Microsofties and Haters alike.
Google obviously chose the right tool for the job; instead of “I know, we’ll use WTL – that’ll really stick it to Microsoft!!!”. How purile.
What are you talking about? Who’s painting what as what? It’s just a funny, interesting coincidence, that’s all. And to make it even more interesting, the source article takes a detailed look at the code in question, and seeing quite a few of our readers are developers, this is a perfectly fine item to post.
I’m referring to the OSAlert article title/summary rather than the article itself. OSAlert is clearly looking for page views here.
— I should add that the DEP hacks are far more interesting and the OSAlert article should have highlighted that.
Edited 2008-09-16 17:03 UTC
I honestly have no idea what brought you to that conclusion. Heck, not even sbergman took it that way, and that really says it all . If I was looking for page views, I could have made the OSAlert summary/headline a lot more sensationalist than this humble little text.
Seriously now, though, I think that if you try hard enough, you can see every item as looking for page views. Which would be rather idiotic, since we get nothing in return for having more page views at all.
This is a perfectly fine, normal item.
Fair enough; the community have spoken.
Wow. I had to recheck the story headline to confirm that it was about Chrome and WTL and not about QT.
Think about it. A piece of truly OSS code (with a BSDish license), released by Microsoft, has found genuine use in a major product from an industry competitor. A few years ago we all would have been stunned. Instead, today, we start quibbling about the relative benefits of QT.
While I am hardly a Microsoft fan, and in fact actively dislike them, I think that a “Welcome to the FOSS community, Microsoft” is in order at this point.
It is not surprising that they’ve chosen to use WTL since many other projects already use it. On Windows if you’re using Visual C++, the choice really boils down to MFC, pure Win32 or WTL. MFC is alright but it is fairly huge and it forces you to use it’s DocView architecture. Nobody really writes in pure Win32 anymore so that leaves WTL, which is actually a very nice library.
The major drawback of WTL is the lack of any decent documentation. There’s nothing on MSDN, there are no books, there isn’t a complete list of classes and what each method does. And this is what annoys me about Microsoft’s approach to WTL.
Instead of focusing manpower on documenting and developing WTL, they’ve just dropped the whole thing on Sourceforge. No documentation. No official support. Nada. That makes the barrier to entry for using WTL since the only reliable documentation is the code. That also means you need to be an expert at the Win32 API, ATL and MFC.
Nevertheless, there are many commercial products that use WTL. Once you get the hang of it, nothing beats it for developing WIN32_LEAN_AND_MEAN applications .
http://msdn.microsoft.com/en-us/magazine/cc163305.aspx
It seems pretty straightforward.
google pwned!
4 those of you who said qt does not integrate well into osx and integrates well with windows and kde
http://img60.imageshack.us/my.php?image=picture6bh5.png
http://code.google.com/p/arora/
please bear in mind its fairly new browser
When people talk about integration, they generally mean look and feel. Screenshots can only convey the “look”. You’ll only get to appreciate the “feel” when you’re sat down and using the software on the target platform.
I know what you mean. Qt apps on Windows and OSX feel snappier i.e. respond more quickly than native windows and especially Cocoa apps. So they feel lighter whereas Cocoa apps feel solid / heavy.
But I like Qt apps so it does not bother me.
I don’t know if you’re being sarcastic, or if you’re serious. What applications are you using that feel so much snappier?
This has got to be a joke. Cocoa is the native toolkit, Carbon is a backwards compatibility wrapper around cocoa, and QT is a widget set that does most if its own drawing on top of carbon. So, QT on Mac is a wrapper on top of a wrapper on top of a wrapper. Plus, QT is a MASSIVE library that duplicates all of the standard c++ stuff, the libs alone are what about 15 MB, all that has to be loaded into memory.
15M???? oh my gods, I don’t know if there is enough left to open any other apps…how will a person get by with only 1019M of ram left.
Oh, the humanity
You use only one application at a time? That’s good to know.
No, I use several, my point is, that 15M of ram is not a lot for an app/framework/toolkit to use. It’s not 1995
And anyway, 15MB is overkill. A simple Qt app will use about 7. Anything non-trivial and the app itself will dwarf the size of the libs.
With Qt4 they split up the library into a bunch of dlls because it was getting too large. Most apps only require QtCore and QtGui dlls, which I think come to about 7-8MBs.
Certainly not something you could call lightweight, but I think perfectly acceptable for a browser that’s going to be using > 100MB anyway.
I haven’t noticed any kind of speed, memory, or non-nativeness issues with the new .9.2 version of VLC, although it certainly has a bunch of UI design issues I wouldn’t have made.
This has got to be a joke. Cocoa is the native toolkit, Carbon is a backwards compatibility wrapper around cocoa, and QT is a widget set that does most if its own drawing on top of carbon. So, QT on Mac is a wrapper on top of a wrapper on top of a wrapper. Plus, QT is a MASSIVE library that duplicates all of the standard c++ stuff, the libs alone are what about 15 MB, all that has to be loaded into memory.
as you can see it looks good in a gtk desktop environment 2
http://img255.imageshack.us/my.php?image=frereffegfxw4.png