Welcome! Wikis are websites that everyone can build together. It's easy!

C/glib

Once it works dbus is easy, and here's the code to make it work. I guess you should perhaps also include glib.h, but it worked just fine without. You should be able to figure out the other functions yourself, so have fun with this piece of code!

#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-bindings.h>

static void setAWNIcon(char *app, char *filename) {
DBusGConnection *connection;
DBusGProxy *proxy;
GError *error;

g_type_init();

error = NULL;
connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);

if (connection != NULL)
{
proxy = dbus_g_proxy_new_for_name(
connection,
"com.google.code.Awn",
"/com/google/code/Awn",
"com.google.code.Awn");
error = NULL;
dbus_g_proxy_call(proxy, "SetTaskIconByName", &error, G_TYPE_STRING,
app, G_TYPE_STRING, filename, G_TYPE_INVALID);
}
}

static void restoreAWNIcon(char *app) {
DBusGConnection *connection;
DBusGProxy *proxy;
GError *error;

g_type_init();

error = NULL;
connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);

if (connection != NULL)
{
proxy = dbus_g_proxy_new_for_name(
connection,
"com.google.code.Awn",
"/com/google/code/Awn",
"com.google.code.Awn");
error = NULL;
dbus_g_proxy_call(proxy, "UnsetTaskIconByName", &error,
G_TYPE_STRING, app, G_TYPE_INVALID);
}
}


Latest page update: made by mycroes , Feb 27 2007, 6:46 PM EST (about this update About This Update mycroes Name is more what it should be - mycroes

No content added or deleted.

- complete history)
Keyword tags: c dbus glib plugin Plugins
More Info: links to this page

There are no threads for this page. 

Anonymous  (Get credit for your thread)


Related Content

(what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)