Brad Wardell's Blog


Developing software in a Windows Vista world

Published on Sunday, September 18, 2005 By Brad Wardell In PDC 2005

Windows Vista is going to provide an immense amount of opportunity for developers. It's going to be a real shakeup for existing developers too.  The reason I say that is that Windows Vista might as well be simply called VistaOS or something because it's a totally different ball game now.

Windows NT 3.1 was released in 1994. Microsoft gave it a new shell and moved the video drivers into Ring 0 and called it Windows NT 4.0 in 1996.  In 2000, Microsoft further refined it, made it more user friendly and called it Windows 2000.  A year later, they skinned it, changed the icons and called it Windows XP.

Building for the future..

Over the past 4 years, Microsoft has looked at where technology is going.  They needed to start replacing basic parts of the OS that were just antiquated at this point.  GDI? A 2D drawing system whose roots were based on the IBM VGA graphics specification (16 colors).  They've patched it up a bit with GDI+ but really, it has no concept of 3D, alpha blending, shaders, etc.  The networking in Windows XP is still based on a hodge podge of networking APIs that were built before over-wedgified losers made us learn words like "worms" and "malware" and "phishing".  So Microsoft developed a managed API called .NET and a new communications foundation code-named Indigo.

You put all that together and you have a pretty damn impressive OS.  On top of that, Microsoft is doing their usual bundle mania which tends to get on my nerves but monopolies do what monopolies can.

To support the new technologies, Microsoft is also creating some pretty impressive development tools.  Sparkle looks simply ingenius.  Let designers do their thing with Sparkle and hand over the XAML it creates to the developer using Visual Studio and they can do their logic behind it.  Microsot is really pushing Windows developers to stop making software that looks like..well crap.  Sparkle and the rest of the Expression Suite seems designed to do that.

Developer Opportunities

As a software developer -- a commercial software developer at that. My job is to figure out how best to take advantage of these new technologies.

In my mind, getting the most out of Microsoft's strategy involves leveraging two things:

Number one, it means making products that allow existing Windows XP users to be able to have some of the more obvious benefits of Windows Vista without being on Windows Vista.  There's plenty of reasons to upgrade to Windows Vista when it comes out, but users who elect to stay with Windows XP (and indeed, it'll be quite awhile before Windows Vista is out) should have some cool stuff to use.

To that end, we're working on WindowBlinds 5, WindowFX 2.5, and DesktopX 3 Pro:

These technologies will show up in the next month in the overall suite call Object Desktop.  Specifically, the Aero glass type technology will be available to WindowBlinds 5 users (beta due out this month).  We've got a bunch of skins in development that take advantage of the new glass technology in WB.  WindowFX is going to provide improved shadow support windows, an alternative Alt-Tab mechanism and window previews for minimized programs.  And DesktopX is going to evolve to more closely align itself with Microsoft's gadget mechanisms.  Gadgets created with DesktopX Pro will hence work on Windows 98, ME, 2000, and XP.

Secondly, it means taking advantage of the new technologies in Windows Vista to create new kinds of software.  In our view,  the Windows Presentation Foundation (Avalon) is particularly promising for creating several new programs to put into Object Desktop. And best of all, Microsoft is committed to bringing WPF back to Windows XP so those users won't be left out.   Stardock is already working on a couple of new programs to be made part of Object Desktop that will heavily leverage WPF and WCF (Indigo).

Which leaves us with the marketing question? When will Windows Vista be released?  Our guess: October 2006.

The Cartman Widget example

Published on Sunday, September 18, 2005 By Brad Wardell In DesktopX Tutorials
Our friends at OSX-E have a great widget tutorial for Konfabulator put together by Herd, talented widget author.

It's a very well written tutorial that walks the user through how to create a widget for Konfabulator.  Since its release, Konfabulator has gotten a lot of great publicity on its ability to create widgets. As the product manager of its primary Windows competitor, DesktopX, I can appreciate Konfabulator as both a technology and as a popular phenomenon.  Its existence has forced us to get a lot better at our own marketing and developer support.

DesktopX precedes Konfabulator by years.  But being a Windows-only product, we haven't gotten anywhere near the press that Konfabulator received so often times Mac users believe that user created mini-applets on the desk originated with it. 

DesktopX is object-oriented in nature.  Users make their creations with objects. When they are done, they can export their creations as widgets or as entire desktops.  For that reason DesktopX has a disadvantage -- it seems more complicated than Konfabulator to a new user.  Because it can be used to create a lot more kinds of things and its development aspects are part of the environment, it can come across as more complicated. 

DesktopX 3 Pro adds one further wrinkle, users can export their creations also as gadgets. Gadgets are identical to widgets but require no additional downloads to make them work. They are independent programs. 

What's really cool about Herd's Konfabulator tutorial is not just that it's well written, but it illustrates what's involved in creating even a simple Konfabulator widget. So for the purposes of an apples and apples comparison, I'm going to create nearly the same widget with DesktopX and walk you through how you'd create the Cartman widget with it.

Cartman: The Widget!

Tools Needed:

  • A drawing program (something capable of making PNG images with per pixel translucency).
  • A web browser or Acrboat reader for reading the DesktopX reference manual.
  • Patience!

Prerequisites to understanding this tutorial:

  • Very basic programming experience -- any language will suffice.
  • The ability to learn a fairly straight forward GUI interface.
  • Some math - just enough to figure out how often you want Cartman to blink or smile and such.

DesktopX: No XML it's all GUI or Programming - whichever you prefer

The most significant difference between DesktopX 3 and Konfabulator from a widget creation point of view is that with Konfabulator you define your widget in XML.  With DesktopX 3, you can either use the DesktopX GUI to create objects and object states (which is what I am going to do here because I prefer that) or you can do everything in JavaScript.  There is no XML writing involved in creating a DesktopX widget.

JavaScript in DesktopX

DesktopX supports Windows Scripting Host.  So any scripting language you have installed on your computer you can use. However, since Windows supports JavaScript and vbScript out of the box, it's generally best to use those.

Both vbScript and JavaScript are quite rich in what functionality they provide. For instance, I use the random function (Math.random). That's not part of DesktopX. That's a feature of JavaScript.

Coding in DesktopX

DesktopX includes a built in editor. You don't have to use it but it has an intellisense type feature that allows you to browse the various DesktopX classes.  Example, type Object. (object-dot) and upon hitting the period key a context sensitive list of object methods appear that let you know what's available.  You can always code in your favorite editor and paste it in though. DesktopX will also highlight mistakes you made on the fly.

So let's get started. Our goal is to create a little Eric Cartman (from the popular TV show "South Park") that sits on your desktop and makes faces on occasion. Nothing very fancy but enough to walk you through the basics.  Since the thrust of this tutorial is to contrast how one creates widgets in Konfabulator, I strongly recommend reading Herd's excellent tutorial as he is really the one who put this together and this is a derivative of it.  The goal is to provide an apples to apples comparison.

Step #1: Create the Cartman object.

When you load up DesktopX, it adds itself to your system tray. Right click on it and choose "new object". You will then see this.

 

Step #2: Change the image

So then I press the "Change" button and change its image.

 

Step #3: Create the eye and mouth objects

Repeating what you did to create the first object, create the face and eye objects. Essentially, the Cartman tutorial creates a widget that is Cartman with random changes to his eyes and mouth.

 

Step #4 Add the states

We have images for Cartman blinking, Cartman looking mad, etc.  I could create these states in Javascript but I prefer to add them to the actual object as I find it makes debugging easier to explicitly create states in the GUI.  Very easy to do though. Just press the add button, name your state, and then choose the image.

Do this for the eyes and the mouth.

 

Step #5: Name your objects

So far I've made 3 objects. I'm going to be doing things to two of them (the eyes and the mouth). So I'm going to name my objects so that I can refer to them in script. I name one of them "eyes" and the other "mouth". This is done on the summary tab.

 

Step #6: Write the code

I choose my main Cartman object and click on properties and then press the "new" script.

 

Which brings up the editor. To make sure this is truly apples and apples, I change my language to "javascript" (make sure you remove the VB script code in there before you choose Javascript).

 

The Java-Script I've written is a little bit different than from the tutorial since DesktopX's needs are different.  The first part is the constructor:

//Called when the script is executed
function Object_OnScriptEnter()
{
  DesktopX.Object("Eyes").Width = 75
  DesktopX.Object("Eyes").Height = 41
  DesktopX.Object("Mouth").Width = 46
  DesktopX.Object("Mouth").Height = 21
  Object.SetTimer(12,800);
}

What is happening:

  • In Herd's tutorial, he resizes the images to be 70% of what they originally were. While I could do that, I prefer to know precisely the size I'm dealing with so I resized the eyes and mouth to be a specific size. 

  • I am accessing the other objects through the DesktopX class. I type DesktopX.Object and then the name of the object I want to access and then use its methods to manipulate it.

  • The last thing I do is I create a timer.  Every 800ms I call timer 12 which calls a function called DoFace():

//Called by the timer trigger every 800ms.
function doFace()
{
  i = Math.round(Math.abs(Math.random()*30));
  if(i==4)DesktopX.Object("Eyes").State = "closed";
  if(i==5)DesktopX.Object("Eyes").State = "drowsy";
  if(i==6)DesktopX.Object("Eyes").State = "hng";

  i = Math.round(Math.abs(Math.random()*40));
  DesktopX.Object("Mouth").State = "Default";
  if(i==0)DesktopX.Object("Mouth").State = "grr";
  if(i==1)DesktopX.Object("Mouth").State = "down";
  if(i==2)DesktopX.Object("Mouth").State = "smile";
}

What is happening:

  • I am using the JavaScript math function to generate a random number between 0 and 29. I then do a standard IF THEN statement to change the state of my objects based on the result.

  • I want my eyes to blink or whatever on occasion. Therefore, I played with this number until I found a value that seemed life like (I originally did the 5 second one but I wanted it to be random). 

Step 7: Group them together

So at this point my objects would be separated and doing their thing which looks strange. So I drag and drop them together to create my Cartman. Then I drag select them all, choose group and give them a name.

 

Step 8: Export them as a widget..

Select Export

 

Since I'm using DesktopX Pro I can export it as a stand-alone program.

 

 

And Finally..

 

There's my stand alone Cartman. 

 

Conclusions

I didn't bother to create a properties dialog for the gadget to change settings but that would have been a couple more lines (I can do that if anyone is interested).  The goal is to let people see how widget/gadget creation in DesktopX compares to doing the same in Konfabulator.  Mind you, I could have done the whole thing in VB Script or JavaScript without ever using the GUI, I just find it a little easier to deal with graphics in the GUI and have the code handle logic.  

For the aspiring software developer, the ability to use DesktopX 3 to rapidly develop a mini-application entirely in JavaScript or vbScript has some significant advantages we feel.  And for artists who are not as familiar with coding, having a fairly straight forward GUI available to create and put together objects makes creating mini-applications more approachable.

You can learn more about DesktopX 3.0 at http://www.desktopx.net.  The standard version of DesktopX 3.0 is $24.95 and allows you to export widgets that can be run by anyone who has DesktopX installed.  For $69.95 you can purchase DesktopX 3.0 Pro which allows you to export your creations as stand-alone programs.

For Windows Vista developers, DesktopX Pro becomes particularly interesting as Windows Vista will have native support for gadgets and Microsoft has embraced the gadget concept.

Files

Cartman.zip (521K) - yes, it's a stand alone program, no other files needed.

 

Special Thanks

A big thanks to Herd who created the Konfabulator tutorial that this tutorial is based on. My technical writing skills pale in comparison as is obvious but hopefully I have been able to do justice to his fine tutorial concept.

PowerUser.TV: Episode 6

Published on Saturday, September 17, 2005 By Brad Wardell In Entertainment
Episode 6 of our podcast, PowerUser.tv is up! Check it out for lots of commentary on the latest tech news by me, Kristin Hatcher, Tom Chick (Quarter to Three), and WishX from Neowin.net

Object Desktop Fall Preview

Published on Saturday, September 17, 2005 By Brad Wardell In WinCustomize News

This fall Object Desktop users are in for a real treat.  WindowBlinds 5 alpha 1 is expected to come out sometime this month.  Moreover, WindowFX 2.5 is nearly complete and it has some cool new features such as taskbar previews and a Ctrl-Tab feature that lets people cycle through their running programs quickly and more visually than the existing Alt-Tab method.  More to come. Stay tuned..

If you don't already have Object Desktop, now's a good time to get it. There's an upgrade path also for people who have one of the stand-alone programs of it.  Object Desktop users get everything already available for it plus all updates and new programs we add for a year after purchase!

Microsoft Gadgets understood

Published on Thursday, September 15, 2005 By Brad Wardell In PDC 2005

Our story so far..

In 2000 Stardock released DesktopX which gave Windows support for desktop objects. These objects could be used to build entire desktops or exported as mini-applications called "widgets".

DesktopX became pretty popular with millions of users downloading it and trying it out.  Unfortunately, most of the content created by developers looked like it was made by developers.  3 years later, a Mac developer released Konfabulator which also created mini-applets.  They wisely included a series of incredibly polished looking widgets that showed off what could be done.  Combined with excellent marketing, Konfabulator became very well known.

In 2005, Stardock released DesktopX 3 which also came in a Pro version that could create gadgets.  Gadgets are like widgets except they don't require the user to download an enabler. The gadget contains the executable code within it it needs to function. 

In July 2005, Yahoo acquired Konfabulator rebranding it Yahoo Widgets.  The question came up, what is DesktopX's future? Why would developers create widgets/gadgets for DesktopX over making them for Konfabulator?

The answer came in September 2005 with Microsoft's announcement of Microsoft Gadgets.  From an end user point of view, Microsoft's gadgets are identical to Stardock's gadgets.  However, under the cover, Microsot's gadgets are different and use what we'll loosely call the shared Gadget specification that I will discuss below.  The bottom line is that by Windows Vista, gadgets are gadgets are gadgets. The reason for developers to target using DesktopX rather than Yahoo Widgets is that DesktopX's gadgets won't require additional downloads and will support Microsoft's gadget technologies.

So what is going to be the shared gadget specification?

1) Exported gadgets can be .EXEs or .GADGET.  But only .GADGET files will be able to be docked on the Windows Sidebar.  We hope for both implementations to work on Stardock ObjectBar (see screenshot above).

2) A .gadget file is a container file (.ZIP or .CAB renamed). 

3) Inside the .gadget file are:

  • A Gadgets.xml file that describes what the gadget is and provides its security settings.
  • A XAML file that describes the visual elements of it
  • A .CS file (or other scripting file) that handles the logic of it
  • A PNG file that acts as the preview/icon for it

A .gadget file is essentially the same in concept as a .dxpack file today except that .dxpacks contain INI, XML, and PNG files.

What will make the next generation gadgets interesting is Avalon (Windows Presentation Foundation).  Vector based, 3D accelerated content.  You will be able to make gadgets through a variety of methods.  Microsoft's "Sparkle" app would be one example.  DesktopX would be another way. How developers make gadgets will likely come down to their own preferences (and cost -- DesktopX Pro is only $69.95).

Stardock plans to write a plugin that will allow existing gadgets to run on the Windows Sidebar.

DesktopX will have a few examples as a gadget development platform in that it is designed specifically for creating this kind of content (desktop content -- .desktops or .gadgets or widgets).  Whereas Sparkle is a generalized platform with the developer having to do more of the work themselves.  To use a paint program analogy, Photoshop is popular partially because it comes with tons of filters and other things that are handy to artists.  The convenience comes in the form of included tools for making the kinds of things people who created gadgets are likely to want to make use of.

The point being is that there won't be a bunch of different types of gadgets specifications.  Our goal is to make DesktopX to be able to create Avalon based gadgets and provide a path for users and developers to take maximum advantage of all the cool new features coming out in Windows Vista.  Of course, this won't happen overnight. Windows Vista is still a ways off. 

Windows Vista and its new games

Published on Thursday, September 15, 2005 By Brad Wardell In WinCustomize News

In the name of journalism or whatever the heck I'm doing, I spent hours today carefully and painstakingly evaluating the new Windows Vista games. Then I took some screenshots and uploaded them to my WinCustomize personal photo album (do YOU have one? Why not?). 

Anyway, Microsoft has revamped the existing games completely -- even Mindsweeper and introduced some new ones to the mix.  Check out the screenshots and thus validate the hours I spent "researching" this article...

PDC 2005: Vista Game Screenshots!

Published on Thursday, September 15, 2005 By Brad Wardell In PDC 2005

The games that come with Windows XP are pretty dated.  But with Windows Vista, Microsoft has gone back to the drawing board.  Included in Vista is a whole slew of updates to classics along with some new games including a pretty nice chess game.  Check out the screenshots below.

 

The new chess game is pretty impressive.
Minesweeper gets a much needed update
Mahjong! Yes!
I'm not quite sure what this game is..
Microsoft's dialogs are getting better.
Solitair gets an update too.

Yet another screenshot

Published on Thursday, September 15, 2005 By Brad Wardell In PDC 2005

I liked what they do with the Vista scrollbars.  You can't really see it in this screenshot but they are pretty gray and non-descript normally but when you mouse over a scrollbar, it changes into what you see here which looks nice.