Dev (#6) - Cairo clock hacked together with CWIID… (#92) - Message List

Cairo clock hacked together with CWIID…
 unsolved

So I was bored this afternoon, and combined cairo clock with CWIID. Upon opening, you are presented with the connection dialog from cwiid-gui. Before you connect to the wiimote, cairo clock works as normal; upon connecting with the wii-mote, roll (pulled from the wiimote's accelerometer) is translated into the second hand of cairo clock. Please note that I have done little else besides hello worlds and bug fixes with C, so my coding is atrocious, and it segfaults if it can't connect with the wiimote. To build it, grab the latest tarball from macslow's page:  http://macslow.thepimp.net/?page_id=23

run ./configure, and you will have to modify 'Makefile' under src. You need to modify the dependencies to read like so:

GTK_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/path/to/cwiid-0.6.00/common/libcwiid -I/home/rich/Desktop/cwiid-0.6.00/common/include GTK_DEP_CFLAGS = -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libxml2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/librsvg-2 GTK_DEP_LIBS = -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lgdk-x11-2.0 -latk-1.0 -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lpango-1.0 -lcairo -lX11 -lXfixes -lrsvg-2 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -L/path/to/cwiid-0.6.00/libcwiid -lcwiid GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lpango-1.0 -lcairo -lX11 -lXfixes -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0

Of course change /path/to/cwiid-0.6.00/ to wherever you have the header files and, and you can leave out the '-L/path/to/cwiid-0.6.00/libcwiid' if it is in your library path (mine isn't).

Why did I do this? To learn more about cwiid and cairo clock. It should be easy to add 'minute' and 'hour' hands back in for the Y and Z axis; I just haven't gotten to it yet. Perhaps someone can help me with getting a better range for display on the cairo clock (currently, I use this function to calculate the angle to display the second hand: fAngleX = ((double) w_Xaccel * 1.40626f ) + 185.0f; - perhaps something with less range?). Stupid, I know, but entertaining.

Oh...the patch to cairo-clock.c:

 http://pastebin.com/f32cb24bb

  • Message #24380

    That should have read:

    GTK_CFLAGS = -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/home/rich/Desktop/cwiid-0.6.00/common/libcwiid -I/path/to/cwiid-0.6.00/common/include

    GTK_DEP_CFLAGS = -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libglade-2.0 -I/usr/include/gtk-2.0 -I/usr/include/libxml2 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/librsvg-2

    GTK_DEP_LIBS = -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lgdk-x11-2.0 -latk-1.0 -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lpango-1.0 -lcairo -lX11 -lXfixes -lrsvg-2 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -L/path/to/cwiid-0.6.00/libcwiid -lcwiid

    GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lpango-1.0 -lcairo -lX11 -lXfixes -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0

Attachments

No attachments created.