Sunday, February 10, 2008

How to make NeoDock Manager see my Plugins?

The NeoDock Manager is an application to build the Neo Dockstation. It detects installed plugins and shows them up on the interface so that you can add it to the dockstation. This tutorial shows how you can make your other plugins show up on NeoDock Manager. To do this, you shall need 2 XML files, 1 DLL file and some cosmetics!!

Let me start with how the Neo Dockstation works. There is nothing too tricky in it. The dockstation starts with the current theme XML file. Using two marker lines, it knows which plugin tag corresponds to the top portion of the Neo interface. The rest is simple. It creates a new layout file with the plugin tag from the current theme removed and inserts the plugin tag for the plugin to be loaded. After that it just loads this new layout!! Sometimes the most trivial is not the easiest to find - I went through the whole process of writing a plugin that loads other plugins before stumbling upon this method.

So, back to NeoDock Manager. Lets say you want the default status bar plugin to be visible in NeoDock Manager.

1) Create a folder in \Program Files\NeoDock\Plugins. You can name it anything. Say we call it "Shadow Status Bar".

2) Inside the folder, you shall have to create two XML files - one must be named setup.xml, the other one your choice, say we name it monobar.xml.

3) The setup.xml is what the NeoDock Manager will parse to find information about a plugin. Here is how it looks for the Shadow iconbar:

<?xml version="1.0" encoding="UTF-8" ?>

<neodock>


<plugin name="Shadow Iconbar" dllsource="\Windows\tpcutil.dll" clsid="
{837FC251-FE69-43ad-84E0-EBCEDEBA0884}" xmlsource="\Program Files\NeoDock\Plugins\Shadow Status Bar\monobar.xml">

<config exe="" />

<icon source="\Program Files\NeoDock\Plugins\Shadow Status Bar\iconbar.png" />

<title text="Status Bar" />

<description text="Default Icon Notifications" />

</plugin>

</neodock>

Lets take a look at these tags one by one.

neodock: This tag is a must to indicate that you are writing a setup for a NeoDock plugin.

plugin: This tag and all of its attributes is a must.


name = name that NeoDock Manager should display in its interface for this plugin.

dllsource = full path to the dll for this plugin.

clsid = GUID of this plugin.

xmlsource = full path to the xml file for this plugin. I shall explain what this file contains in a while.


The following four entries are optional.

config: exe = full path to the executable that can be used to configure this plugin.

icon:
source = full path to the image to display for this plugin in the dockstation.

title: text = a title for this plugin; used in the dockstation.

description: text = a description for the plugin; used in the dockstation.

4) Now lets create the other XML file - monobar.xml. This file contains the plugin tag that usually goes into the theme layout XML file. For the shadow status bar its something like this -

<plugin clsid="{837FC251-FE69-43ad-84E0-EBCEDEBA0884}" name="iconbar" height="20">

<iconbar fgcolor="COLOR_TRAYTEXT"/>


<background bgimage="\windows\CHome_framework_status_bar_bg.png" halign="center" bgcolor="COLOR_TRAYGRADLEFT" b-border-color="COLOR_WINDOWFRAME"/>


</plugin>
5) That's about it. The next time you run NeoDock Manager, it will scan through all folders in \Program Files\NeoDock\Plugins and will parse the setup.xml files in those folders. If everything is valid and relevant files do exist, the plugin would show up on the Manager. Thereafter you can add it to the dockstation.

Validity checks are made for the attributes in the plugin tag, meaning, the dll and xml files must be present at the location specified and the CLSID should match with the one given in the second xml file (monobar.xml in this example) . Other tags have some default values if not present.

The Manager attempts to create the required GUID entry in the registry for the dll. However, if an entry already exists with the given GUID, it shall not overwrite it. This is because, you might have made a mistake in specifying the right GUID for the plugin dll, in which case, overwriting the entry with the wrong information may crash some other program.

Feel free to leave me a comment if you have a problem! And also, please let me know if you find cool non-selectable plugins perfect for the Neo Dockstation.

8 comments:

markanthonypr66 said...

Hello Rinku,

I'd like to know if from your vast experience, you think I could posibly install this plugin on my SDAII (htc Tornado).

Rinku said...

Mark,

I would very much wish that it worked with other devices. However, the application uses certain features of the Neo interface to facilitate the switching. I do not think it would work on the Tornado. I appreciate your inquisitiveness.

james said...

rinku,

i would like to write a plugin for the dockstation...really as more to learn how to, then the actual final product. i have an idea, but don't know how to make a dll or exe (your directions here are great, but for someone green like me the other half of the puzzle is still unknown.) where is a good first start for someone wanting to learn how to do this?

thanks much.

Rinku said...

James,

The first thing to do is understand the architecture of a plugin. Here is a link - http://msdn2.microsoft.com/en-us/library/bb278109.aspx . There is nothing specific you would have to do in the development to use it with the dockstation. Just follow the steps here to make the Manager see it. Keep me updated on your progress!!

cindy said...

Hi Rinku,

i was just wondering if its possible to make a plugin for TCPMP to show the now playing status at the top...much like the WMP plugin, since i dont use WMP to listen to my music =(
anyways thank you very much for the neodock! i'm lovin' it so much <3...it's probably the most useful app ever built for the shadow =)

Rinku said...

Cindy,

Thanks for your appreciation of the application. Unfortunately, I do not have a TCPMP plugin written for it. I haven't really had the time in the last few weeks to sit down and write more plugins for the dockstation.

icon manager said...

this is one of the best blog i have ever seen.

willy said...

your blog is helpfull for me
thanks n see my post
blog contest
download youtube
ubah kepemilikan windows vista
trik basmi virus
kaligata
luka berdarah
asma