summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-06-21 20:47:22 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-06-21 20:47:22 +0000
commit11056f564b04a956fd3428d7257c839a609fd53e (patch)
treef0ba80f60b9d46230d393b9d39ba132c518da0f0 /demos
parent443e8c395e9f45d89f669c944366055eead5d021 (diff)
downloadgdk-pixbuf-11056f564b04a956fd3428d7257c839a609fd53e.tar.gz
Welcome aboard, gdk-pixbuf.
Wed Jun 21 16:38:13 2000 Owen Taylor <otaylor@redhat.com> * gdk-pixbuf/* docs/reference/gdk-pixbuf/*: Welcome aboard, gdk-pixbuf. * gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init): fixups for GObject. * gdk/Makefile.am gdk/gdkpixbuf-render.[ch] gdk/gdkpixbuf.[ch]: Bits of gdk-pixbuf with GDK dependencies moved into GDK. * gtk/Makefile.am gtk/gdk-pixbuf-loader.[ch]: Temporarily move gdk-pixbuf-loader here until GObject has signals. * demos/: New directory of demos. Move demos from gdk-pixbuf here. * demos/pixbuf-init.c: Small bit of code to check for loaders in ../gdk-pixbuf/.libs/gdk-pixbuf, and if found, set GDK_PIXBUF_MODULEDIR appropriately. * gdk/gdkcompat.h: Remove GDK_DRAWABLE_PIXMAP compat define which no longer makes sense.
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 000000000..000e5b394
--- /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 000000000..a0fcc3d67
--- /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 199ee3249..77e7c9405 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 000000000..3d4edee09
--- /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 66db24565..d3aeb7f28 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 c250f2dfb..e8cfeae0d 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 a99977fbd..863c076ba 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 fe031877f..cb1092c1a 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);