Skip to content

Commit

Permalink
Account for dbus api change in compiz 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
thjaeger committed Aug 10, 2011
1 parent c1ba1a7 commit 8e0f187
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
12 changes: 10 additions & 2 deletions annotate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "annotate.h"
#include <stdio.h>
#include <X11/Xlib.h>

Annotate::Annotate() {
const char *ofc = "org.freedesktop.compiz";
Expand All @@ -23,8 +25,14 @@ Annotate::Annotate() {
g_error_free(error);
throw DBusException();
}
draw_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/annotate/allscreens/draw", ofc);
clear_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/annotate/allscreens/clear_key", ofc);

char draw[256];
char clear[256];
snprintf(draw, sizeof(draw), "/org/freedesktop/compiz/annotate/screen%d/draw", DefaultScreen(dpy));
snprintf(clear, sizeof(clear), "/org/freedesktop/compiz/annotate/screen%d/clear_key", DefaultScreen(dpy));

draw_proxy = dbus_g_proxy_new_for_name(bus, ofc, draw, ofc);
clear_proxy = dbus_g_proxy_new_for_name(bus, ofc, clear, ofc);
}

void Annotate::draw(Point p, Point q) {
Expand Down
10 changes: 8 additions & 2 deletions fire.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "fire.h"
#include <X11/Xlib.h>
#include <math.h>

Fire::Fire() {
Expand All @@ -24,8 +25,13 @@ Fire::Fire() {
g_error_free(error);
throw DBusException();
}
point_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/firepaint/allscreens/add_particle", ofc);
clear_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/firepaint/allscreens/clear_key", ofc);
char add[256];
char clear[256];
snprintf(add, sizeof(add), "/org/freedesktop/compiz/firepaint/screen%d/add_particle", DefaultScreen(dpy));
snprintf(clear, sizeof(clear), "/org/freedesktop/compiz/firepaint/screen%d/clear_key", DefaultScreen(dpy));

point_proxy = dbus_g_proxy_new_for_name(bus, ofc, add, ofc);
clear_proxy = dbus_g_proxy_new_for_name(bus, ofc, clear, ofc);
}

void Fire::add_point(float x, float y) {
Expand Down
6 changes: 5 additions & 1 deletion water.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "water.h"
#include <X11/Xlib.h>
#include <stdio.h>

Water::Water() {
const char *ofc = "org.freedesktop.compiz";
Expand All @@ -23,7 +25,9 @@ Water::Water() {
g_error_free(error);
throw DBusException();
}
line_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/water/allscreens/line", ofc);
char line[256];
snprintf(line, sizeof(line), "/org/freedesktop/compiz/water/screen%d/line", DefaultScreen(dpy));
line_proxy = dbus_g_proxy_new_for_name(bus, ofc, line, ofc);
}

void Water::draw(Point p, Point q) {
Expand Down

0 comments on commit 8e0f187

Please sign in to comment.