Sign in to follow this  
Followers 0

Xwdock 2.0.0.0 - Plugins Development

35 posts in this topic

Hello XWDock developers.

At first, you can found ExampleDocklet in Plugins\ folder. There is XWDAPI.h/.cpp, [project name].def, main.cpp

So, first of all, look at XWDAPI.h. There are 2 functions:

1.

XWDBool XWDAPICALL XWDExec(XWDFunction function, ...);

2.

XWDError XWDAPICALL XWDGetLastError();

As you can see, calling XWDGetLastError, to get detail infromation, it makes sense if XWDExec returns XWDFalse. I think there is no problems with it.

What about XWDExec. This is the main function, which contains all API.

XWDFunction function - you can found this enumeration just above XWDExec's implementation in XWDAPI.h.

Look at it carefully. For example:

XWDGetRootPath,
/*
Return path of the dock

XWDString - result
*/

It means, that to get root folder of XWDock in your plugin you should do following:

XWDString buff;
XWDBool ret = XWDExec(XWDGetRootPath, buff);
if(ret == XWDTrue)
{
// here we have, for example, buff = L"C:\\Program Files\\XWindows Dock\\";
}

The main idea, it's to use Unicode and call all API using the same way (same function XWDExec);

What about a plugin's structure

In .def file you can found these functions:

XWDGetPluginType
XWDGetPluginIcon
XWDGetPluginInformation
XWDPluginInitialize
XWDPluginDeinitialize
XWDPluginEvent

It's also very easy to understand how it works.

1. XWDGetPluginType - just return one of the constants, that describe what destination of your plugin.

2. XWDGetPluginIcon - fill XWDString buff in your icon's name (.ico, .png...) without full path, only name and return XWDTrue if your plugin has the icon, otherwise return XWDFalse.

3. XWDGetPluginInformation - XWDock calls this function when it needs to get to know more details about your plugin (its author, description, version and so on)

4. XWDPluginInitialize - has only one parameter, XWDId id - it's an unique identificator of your plugin. Also, if you want to store your own data, return a pointer on it as a result of the function.

5. XWDPluginDeinitialize - calls when plugin must be shutdown, here you must free your all resources

6. XWDPluginEvent - it's a callback from XWDock to your plugin. Use XWDEvent uEvent - to get to know what happened, and va_list args to get additional parameters (see XWDEvent enumeration).

So, feel free to ask me about new functionality for XWD API, I will be glad to discuss it with you.

0

Share this post


Link to post
Share on other sites

Of course, but to do it you should rewrite XWDAPI.h/.cpp to C# and exports functions.

Well I manage alone or give me a hand ?

0

Share this post


Link to post
Share on other sites

hey i`m wondering what version of visual c are you using to develop the plugins in this exemple?

0

Share this post


Link to post
Share on other sites

Hmm... it doesn't metter where you are going to develop plugins! It can be MS VS2005/2008/2010 or even MinGW and other compliers. It's simple C++ (I can even think that it's simple C) cause I don't use any of libraries, it's clear C/C++ language. Just develop it where you feel well.

0

Share this post


Link to post
Share on other sites

thanks for tip :P a have some other questions like:

I started to develop a docklet named YahooMessenger that will allow users to add a contact, set online, offline status with just some simple clicks, but being novice in this new style of programing (i know well to program in c, c++ but not visual c) i`m wondering how i can link this plugin that i`m trying to make with the YahooMessenger application so when i click for exemple: "add contact" from the docklet menu then automatically open the add contact window from YMessenger?

Please give me some tips of how to do that? (linking the docklet with the ymessenger application or with some other necessary dll`s from there)

THX in advance! :rolleyes::):D

0

Share this post


Link to post
Share on other sites

I don't know YMessenger API, but I think you have to find API first, then using plugin for the dock (item in menu of the dock) call API to add contact to YM. It's problem not mine (not XWD API). It depends on YM API and how they developed and organized everything in it.

0

Share this post


Link to post
Share on other sites

How do you make skins? I know there was a skin maker in XWDock 5.something, but how do you do that in 2.0.2?

Never mind. I figured it out.

Life sucks. Suck it up and deal with it.

Edited by YOUR MOM
0

Share this post


Link to post
Share on other sites

how about adding a mouse-enter/-leave event, to be able to update label only when its shown.

Edited by krizzmp
0

Share this post


Link to post
Share on other sites

how about adding a mouse-enter/-leave event, to be able to update label only when its shown.

You know I think it doesn't make sense, if mouse is out you can call API to update label, dock just replaces the string in memory and anything else. So, it won't take a lot of cpu if you call it always.

0

Share this post


Link to post
Share on other sites

Can you make the genie effect plugin for me ? i would be so grateful ;b

Thanks

___________________________________________________

LOL what a cut question..

0

Share this post


Link to post
Share on other sites

Can you make the genie effect plugin for me ? i would be so grateful ;b

Thanks

Yes, strange question in this topic :)

0

Share this post


Link to post
Share on other sites

Is it possible to add entries on dock by using a plugin? And is it possible to resize dock by a command within a plugin?

0

Share this post


Link to post
Share on other sites

Hi All.

I'd like to say that I've started new API for the dock. Why? I've got an idea so that any application (yes, exactly apps/.exe files) can use dock's api. Why not? I think it's cool. It gives to developers use any of the languages available for Windows. Right now and for example, I will use WPF/C#. So, a short example how simple use dock's API right in the application code.

Here is a class of the main window's code

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}

protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);

DockIcon.Initilize(@"5.ico", textBox1.Text); // init with icon and title, it means add new icon of the application
}

protected override void OnClosed(EventArgs e)
{
DockIcon.Dispose();

base.OnClosed(e);
}

private void button1_Click(object sender, RoutedEventArgs e)
{
DockIcon.SetIcon(@"5.ico"); // change icon
}

private void button2_Click(object sender, RoutedEventArgs e)
{
DockIcon.SetIcon(@"6.ico"); // change icon
}

private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
{
DockIcon.SetTitle(textBox1.Text); // change title
}

private void button3_Click(object sender, RoutedEventArgs e)
{
DockIcon.Bounce(DockIcon.BounceType.Normal, 1); // bounce effect
}

private void button4_Click(object sender, RoutedEventArgs e)
{
DockIcon.Bounce(DockIcon.BounceType.Attention, 1); // bounce effect
}
}

0

Share this post


Link to post
Share on other sites

Can i override some funtions about xwdocks behaivor, like .... width ?? , i want to create a plugin that can simulate the PANEL MODE like DOCKY in linux ....

I can compile the example plugin ,sais , is missing the def file .... using VS 2010 express .... any problem ??

Edited by Suicidalpain
0

Share this post


Link to post
Share on other sites

Can i override some funtions about xwdocks behaivor, like .... width ?? , i want to create a plugin that can simulate the PANEL MODE like DOCKY in linux ....

I can compile the example plugin ,sais , is missing the def file .... using VS 2010 express .... any problem ??

Yep, there is a problem, ExampleDocklet.def but in project file it's named ExmapleDocklet.def. I think you can simply rename file to ExmapleDocklet.def. And you cannot control behavior of the dock by plugins yet, may in future I'll implement a type of plugins to make possible change behaviour of the dock.

0

Share this post


Link to post
Share on other sites

Hi All.

I'd like to say that I've started new API for the dock. Why? I've got an idea so that any application (yes, exactly apps/.exe files) can use dock's api. Why not? I think it's cool. It gives to developers use any of the languages available for Windows. Right now and for example, I will use WPF/C#. So, a short example how simple use dock's API right in the application code.

Here is a class of the main window's code

[...]

Maybe I'm missing something obvious but it seems like it's hard to find the new C# API documentation and/or some full sample code... can anyone help me out?

BOBAH13, have you already ported all of the C function headers to more native C# arguments?

0

Share this post


Link to post
Share on other sites

Maybe I'm missing something obvious but it seems like it's hard to find the new C# API documentation and/or some full sample code... can anyone help me out?

BOBAH13, have you already ported all of the C function headers to more native C# arguments?

You can find c# (.cs file) class in sources folder in xwd folder. Just you this class's methods and that's all. What's the problem?

0

Share this post


Link to post
Share on other sites

Hi All, have just started using the dock (xp). Was wondering if there is a plugin/docklet for the system tray and taskbar. Also, I can't find any single place where I can download more plugins...

0

Share this post


Link to post
Share on other sites

Hi All, have just started using the dock (xp). Was wondering if there is a plugin/docklet for the system tray and taskbar. Also, I can't find any single place where I can download more plugins...

You're not the only one.. Been lookin for plugins all day

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0