1 /* Be clean and pure (yeah, right!) */
2 #define GTK_DISABLE_DEPRECATED
3 #define G_DISABLE_DEPRECATED
5 #include "wvglibstreamclone.h"
7 #include "wvistreamlist.h"
8 #include <gconf/gconf-client.h>
11 static void gconf_notify(GConfClient
*client
,
16 if (gconf_entry_get_value(entry
) == NULL
)
17 fprintf(stderr
, "value is NULL\n");
18 else if (gconf_entry_get_value(entry
)->type
== GCONF_VALUE_STRING
)
20 fprintf(stderr
, "value is a string.\n");
21 fprintf(stderr
, " ... '%s'\n", gconf_value_get_string(
22 gconf_entry_get_value(entry
)));
25 fprintf(stderr
, "value is something else!\n");
29 int main(int argc
, char **argv
)
33 WvIStreamList
*list
= new WvIStreamList
;
34 WvTCPConn
tcp("127.0.0.1", 4111);
35 list
->append(&tcp
, false);
36 list
->append(wvcon
, false);
37 tcp
.autoforward(*wvcon
);
38 wvcon
->autoforward(tcp
);
40 WvGlibStreamClone
glibstream(NULL
, list
); // glibstream now owns list
43 GConfClient
*client
= gconf_client_get_default();
45 gconf_client_add_dir(client
, "/test",
46 GCONF_CLIENT_PRELOAD_NONE
, NULL
);
48 fprintf(stderr
, "initial a: '%s'\n",
49 gconf_client_get_string(client
, "/test/a", NULL
));
51 notify_id
= gconf_client_notify_add(client
, "/test/a", gconf_notify
,
53 notify_id
= gconf_client_notify_add(client
, "/test/b", gconf_notify
,
56 GMainLoop
*loop
= g_main_loop_new(NULL
, 0);
57 g_main_loop_run(loop
);
59 g_object_unref(G_OBJECT(client
));