From 28b3445f1ae74b4e436723c56e986ffb1c8aec22 Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Sun, 28 May 2000 15:17:38 +0000 Subject: [PATCH] Ok, some more clean ups to the filter stuff, should have some new filters to play with soon - want to get the stuff correct before I commit some more stuff. dox is the start of dox2 the document viewer based on imlib2. Designed so that the style of the docs is seperate from the contents. Will evolve rapdily over the next week. SVN revision: 2716 --- Makefile.am | 2 +- configure.in | 2 +- dox/.cvsignore | 20 ++++++++++++++++ dox/Makefile.am | 14 +++++++++++ dox/dox.h | 46 ++++++++++++++++++++++++++++++++++++ dox/hotspot.c | 51 ++++++++++++++++++++++++++++++++++++++++ dox/main.c | 8 +++++++ dox/style.dss | 16 +++++++++++++ filters/filter_bumpmap.c | 18 ++++++++------ filters/filter_test.c | 19 +++++++++++---- src/dynamic_filters.c | 5 +++- src/dynamic_filters.h | 6 +++++ 12 files changed, 193 insertions(+), 14 deletions(-) create mode 100644 dox/.cvsignore create mode 100644 dox/Makefile.am create mode 100644 dox/dox.h create mode 100644 dox/hotspot.c create mode 100644 dox/main.c create mode 100644 dox/style.dss diff --git a/Makefile.am b/Makefile.am index 6b594a0..5b0d543 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,7 @@ MAINTAINERCLEANFILES = INSTALL Makefile.in aclocal.m4 config.guess \ ltconfig ltmain.sh missing mkinstalldirs \ stamp-h.in -SUBDIRS = libltdl loaders src filters +SUBDIRS = libltdl loaders src filters dox EXTRA_DIST = \ imlib2.spec \ diff --git a/configure.in b/configure.in index c776058..fe79173 100644 --- a/configure.in +++ b/configure.in @@ -117,5 +117,5 @@ AC_MSG_ERROR([Fatal Error: no FreeType header files detected.]) fi fi -AC_OUTPUT(Makefile loaders/Makefile src/Makefile test/Makefile filters/Makefile demo/Makefile, +AC_OUTPUT(Makefile loaders/Makefile src/Makefile test/Makefile filters/Makefile demo/Makefile dox/Makefile, [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h]) diff --git a/dox/.cvsignore b/dox/.cvsignore new file mode 100644 index 0000000..dfbef89 --- /dev/null +++ b/dox/.cvsignore @@ -0,0 +1,20 @@ +config.guess +config.h.in +config.sub +ltconfig +ltmain.sh +aclocal.m4 +stamp-h.in +Makefile.in +configure +config.log +config.h +config.cache +libtool +config.status +stamp-h +Makefile +.deps +.libs +*.lo +*.la diff --git a/dox/Makefile.am b/dox/Makefile.am new file mode 100644 index 0000000..9f7ead7 --- /dev/null +++ b/dox/Makefile.am @@ -0,0 +1,14 @@ +# A list of all the files in the current directory which can be regenerated +MAINTAINERCLEANFILES = Makefile.in + +LDFLAGS = -L/usr/X11R6/lib +INCLUDES = -I/usr/X11R6/include \ + $(X_CFLAGS) -I$(prefix)/include -I$(includedir) -I. \ + -DPREFIX=\""$(prefix)"\" +LIBOBJS = @LIBOBJS@ + +bin_PROGRAMS = bdox +bdox_SOURCES = main.c dox.h hotspot.c +bdox_LDADD = -lX11 + +EXTRA_DIST = diff --git a/dox/dox.h b/dox/dox.h new file mode 100644 index 0000000..f8ee615 --- /dev/null +++ b/dox/dox.h @@ -0,0 +1,46 @@ +#ifndef _DOX_H_ +#define _DOX_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct __dox_hotspot +{ + char *name; + int x; + int y; + int w; + int h; + struct __dox_hotspot *next; +} DoxHotspot; + +void parse_args( int argc, char **argv ); + +void init_hotspot(); +void add_hotspot( char *target, int x, int y, int w, int h ); +char *check_hotspot( int x, int y ); +void tidy_hotspots(); + +void load_dox( char *file ); +void parse_dox( char *file ); + +void load_dss( char *file ); + + +#endif /* _DOX_H_ */ diff --git a/dox/hotspot.c b/dox/hotspot.c new file mode 100644 index 0000000..b7c7897 --- /dev/null +++ b/dox/hotspot.c @@ -0,0 +1,51 @@ +#include "dox.h" + +DoxHotspot *root; + +void init_hotspot() +{ + root = malloc( sizeof( DoxHotspot ) ); + root->name = strdup( "root" ); + root->x = 0; + root->y = 0; + root->w = 0; + root->h = 0; + root->next = NULL; + printf( "Hotspots initialised.\n" ); +} + +void add_hotspot( char *target, int x, int y, int w, int h ) +{ + DoxHotspot *ptr; + for( ptr = root; ptr->next != NULL; ptr = ptr->next ) + ; + ptr->next = malloc( sizeof( DoxHotspot ) ); + ptr = ptr->next; + ptr->name = strdup( "root" ); + ptr->x = 0; + ptr->y = 0; + ptr->w = 0; + ptr->h = 0; + ptr->next = NULL; + printf( "Hotspot added\n" ); +} + +char *check_hotspot( int x, int y ) +{ + DoxHotspot *ptr; + for( ptr = root; ptr != NULL; ptr = ptr->next ) + { + if( (x >= ptr->x) && (x <= (ptr->x + ptr->w)) && + (y >= ptr->y) && (y <= (ptr->y + ptr->h)) ) + { + printf( "Found Hotspot\n" ); + return ptr->name; + } + } + return NULL; +} + +void tidy_hotspots() +{ + +} diff --git a/dox/main.c b/dox/main.c new file mode 100644 index 0000000..4c6686a --- /dev/null +++ b/dox/main.c @@ -0,0 +1,8 @@ +#include + +int main( int argc, char **argv ) +{ + printf( "dox - version 2.0 - Imlib2\n" ); + init_hotspot(); + return 0; +} diff --git a/dox/style.dss b/dox/style.dss new file mode 100644 index 0000000..a53346f --- /dev/null +++ b/dox/style.dss @@ -0,0 +1,16 @@ +