summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/.cvsignore9
-rw-r--r--demos/Makefile.am58
-rw-r--r--demos/pixbuf-demo.c7
-rw-r--r--demos/pixbuf-init.c19
-rw-r--r--demos/testanimation.c4
-rw-r--r--demos/testpixbuf-drawable.c6
-rw-r--r--demos/testpixbuf-scale.c4
-rw-r--r--demos/testpixbuf.c4
8 files changed, 108 insertions, 3 deletions
diff --git a/demos/.cvsignore b/demos/.cvsignore
new file mode 100644
index 0000000000..000e5b3944
--- /dev/null
+++ b/demos/.cvsignore
@@ -0,0 +1,9 @@
+Makefile
+Makefile.in
+.libs
+.deps
+testanimation
+testpixbuf-drawable
+testpixbuf-scale
+testpixbuf
+pixbuf-demo \ No newline at end of file
diff --git a/demos/Makefile.am b/demos/Makefile.am
new file mode 100644
index 0000000000..a0fcc3d673
--- /dev/null
+++ b/demos/Makefile.am
@@ -0,0 +1,58 @@
+## Makefile.am for gtk+/demos
+
+INCLUDES = @STRIP_BEGIN@ \
+ -I$(top_srcdir) \
+ -I$(top_builddir)/gdk-pixbuf \
+ -I$(top_builddir)/gdk \
+ -I$(top_builddir)/gtk \
+ -DGTK_DISABLE_COMPAT_H \
+ @GTK_DEBUG_FLAGS@ \
+ @GTK_XIM_FLAGS@ \
+ @GTK_LOCALE_FLAGS@ \
+ @PANGO_CFLAGS@ \
+ @GLIB_CFLAGS@ \
+ @more_cflags@ \
+@STRIP_END@
+
+DEPS = \
+ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf.la \
+ $(top_builddir)/gdk/@gdktargetlib@ \
+ $(top_builddir)/gtk/@gtktargetlib@
+
+LDADDS = @STRIP_BEGIN@ \
+ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf.la \
+ $(top_builddir)/gdk/@gdktargetlib@ \
+ $(top_builddir)/gtk/@gtktargetlib@ \
+ @more_ldflags@ \
+ @more_libs@ \
+ @GDK_WLIBS@ \
+ @PANGO_LIBS@ \
+ @GLIB_LIBS@ \
+ @GTK_LIBS_EXTRA@ \
+ -lm \
+@STRIP_END@
+
+noinst_PROGRAMS = \
+ testpixbuf \
+ testpixbuf-drawable \
+ testanimation \
+ testpixbuf-scale \
+ pixbuf-demo
+
+testpixbuf_DEPENDENCIES = $(DEPS)
+testpixbuf_drawable_DEPENDENCIES = $(DEPS)
+testpixbuf_scale_DEPENDENCIES = $(DEPS)
+testanimation_DEPENDENCIES = $(DEPS)
+pixbuf_demo_DEPENDENCIES = $(DEPS)
+
+testpixbuf_LDADD = $(LDADDS) -lgmodule
+testpixbuf_drawable_LDADD = $(LDADDS)
+testpixbuf_scale_LDADD = $(LDADDS)
+testanimation_LDADD = $(LDADDS) -lgmodule
+pixbuf_demo_LDADD = $(LDADDS) -lgmodule
+
+testpixbuf_SOURCES = testpixbuf.c pixbuf-init.c
+testpixbuf_drawable_SOURCES = testpixbuf-drawable.c pixbuf-init.c
+testpixbuf_scale_SOURCES = testpixbuf-scale.c pixbuf-init.c
+testanimation_SOURCES = testanimation.c pixbuf-init.c
+pixbuf_demo_SOURCES = pixbuf-demo.c pixbuf-init.c
diff --git a/demos/pixbuf-demo.c b/demos/pixbuf-demo.c
index 199ee32492..77e7c94058 100644
--- a/demos/pixbuf-demo.c
+++ b/demos/pixbuf-demo.c
@@ -22,8 +22,8 @@
#include <config.h>
#include <stdlib.h>
-#include <gtk/gtk.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
+#include "gtk.h"
+#include "gdk-pixbuf.h"
#include <math.h>
@@ -190,11 +190,14 @@ destroy_cb (GtkObject *object, gpointer data)
gtk_main_quit ();
}
+extern void pixbuf_init();
+
int
main (int argc, char **argv)
{
GtkWidget *window;
+ pixbuf_init ();
gtk_init (&argc, &argv);
gdk_rgb_init ();
diff --git a/demos/pixbuf-init.c b/demos/pixbuf-init.c
new file mode 100644
index 0000000000..3d4edee090
--- /dev/null
+++ b/demos/pixbuf-init.c
@@ -0,0 +1,19 @@
+#include <glib.h>
+
+#include <sys/stat.h>
+#include <stdlib.h>
+
+static gboolean
+file_exists (const char *filename)
+{
+ struct stat statbuf;
+
+ return stat (filename, &statbuf) == 0;
+}
+
+void
+pixbuf_init ()
+{
+ if (file_exists ("../gdk-pixbuf/.libs/libpixbufloader-pnm.so"))
+ putenv ("GDK_PIXBUF_MODULEDIR=../gdk-pixbuf/.libs");
+}
diff --git a/demos/testanimation.c b/demos/testanimation.c
index 66db245656..d3aeb7f286 100644
--- a/demos/testanimation.c
+++ b/demos/testanimation.c
@@ -367,6 +367,8 @@ progressive_updated_callback(GdkPixbufLoader* loader, guint x, guint y, guint wi
static int readlen = 4096;
+extern void pixbuf_init();
+
int
main (int argc, char **argv)
{
@@ -375,6 +377,8 @@ main (int argc, char **argv)
GdkPixbufAnimation *animation;
+ pixbuf_init ();
+
gtk_init (&argc, &argv);
gdk_rgb_set_verbose (TRUE);
diff --git a/demos/testpixbuf-drawable.c b/demos/testpixbuf-drawable.c
index c250f2dfb3..e8cfeae0dc 100644
--- a/demos/testpixbuf-drawable.c
+++ b/demos/testpixbuf-drawable.c
@@ -1,6 +1,6 @@
#include <config.h>
#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
+#include "x11/gdkx.h"
#include "gdk-pixbuf.h"
int close_app(GtkWidget *widget, gpointer data)
@@ -67,6 +67,8 @@ int configure_cb(GtkWidget *drawing_area, GdkEventConfigure *evt, gpointer data)
return FALSE;
}
+extern void pixbuf_init();
+
int main(int argc, char **argv)
{
GdkWindow *root;
@@ -75,6 +77,8 @@ int main(int argc, char **argv)
GtkWidget *drawing_area;
GdkPixbuf *pixbuf;
+ pixbuf_init ();
+
gtk_init(&argc, &argv);
gdk_rgb_set_verbose(TRUE);
gdk_rgb_init();
diff --git a/demos/testpixbuf-scale.c b/demos/testpixbuf-scale.c
index a99977fbda..863c076bab 100644
--- a/demos/testpixbuf-scale.c
+++ b/demos/testpixbuf-scale.c
@@ -52,6 +52,8 @@ expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
return TRUE;
}
+extern void pixbuf_init();
+
int
main(int argc, char **argv)
{
@@ -62,6 +64,8 @@ main(int argc, char **argv)
GtkAdjustment *adjustment;
GtkRequisition scratch_requisition;
+ pixbuf_init ();
+
gtk_init (&argc, &argv);
gdk_rgb_init ();
diff --git a/demos/testpixbuf.c b/demos/testpixbuf.c
index fe031877f6..cb1092c1ae 100644
--- a/demos/testpixbuf.c
+++ b/demos/testpixbuf.c
@@ -484,6 +484,8 @@ progressive_updated_callback(GdkPixbufLoader* loader, guint x, guint y, guint wi
static int readlen = 4096;
+extern void pixbuf_init();
+
int
main (int argc, char **argv)
{
@@ -493,6 +495,8 @@ main (int argc, char **argv)
GdkPixbuf *pixbuf;
GdkPixbufLoader *pixbuf_loader;
+ pixbuf_init ();
+
gtk_init (&argc, &argv);
gdk_rgb_set_verbose (TRUE);