Already a member?
Sign in
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);
}
}
#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
Name is more what it should be
- mycroes
No content added or deleted.
- complete history)
Name is more what it should be
- mycroes
No content added or deleted.
- complete history)
More Info: links to this page