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);
}
}
http://static.wetpaint.com/img/bg/1.png?v=20091124171859
|
Latest page update: made by
, Feb 27 2007, 6:46 PM EST
(about this update
About This Update
- mycroes
No content added or deleted.
-
complete history)
|
|
|
There are no threads for this page.
Be the first to start a new thread.