diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am index 489b4a4e..e9f357c4 100644 --- a/wrlib/Makefile.am +++ b/wrlib/Makefile.am @@ -33,11 +33,13 @@ libwraster_la_SOURCES = \ context.c \ misc.c \ scale.c \ + scale.h \ rotate.c \ flip.c \ convolve.c \ save_xpm.c \ xutil.c \ + xutil.h \ load_ppm.c if USE_GIF diff --git a/wrlib/context.c b/wrlib/context.c index 74790092..1b216a00 100644 --- a/wrlib/context.c +++ b/wrlib/context.c @@ -35,8 +35,8 @@ #include #include "wraster.h" +#include "scale.h" -extern void _wraster_change_filter(int type); static Bool bestContext(Display * dpy, int screen_number, RContext * context); @@ -588,7 +588,7 @@ RContext *RCreateContext(Display * dpy, int screen_number, const RContextAttribu /* get configuration from environment variables */ gatherconfig(context, screen_number); - _wraster_change_filter(context->attribs->scaling_filter); + wraster_change_filter(context->attribs->scaling_filter); if ((context->attribs->flags & RC_VisualID)) { XVisualInfo *vinfo, templ; int nret; diff --git a/wrlib/convert.c b/wrlib/convert.c index b0ab2303..23df5c66 100644 --- a/wrlib/convert.c +++ b/wrlib/convert.c @@ -35,12 +35,9 @@ #include "wraster.h" #include "convert.h" +#include "xutil.h" -#ifdef USE_XSHM -extern Pixmap R_CreateXImageMappedPixmap(RContext * context, RXImage * ximage); -#endif - #define NFREE(n) if (n) free(n) #define HAS_ALPHA(I) ((I)->format == RRGBAFormat) diff --git a/wrlib/scale.c b/wrlib/scale.c index d2cc1e6c..3694be63 100644 --- a/wrlib/scale.c +++ b/wrlib/scale.c @@ -35,6 +35,7 @@ #include #include "wraster.h" +#include "scale.h" /* *---------------------------------------------------------------------- @@ -246,7 +247,7 @@ static double Mitchell_filter(double t) static double (*filterf)(double) = Mitchell_filter; static double fwidth = Mitchell_support; -void _wraster_change_filter(int type) +void wraster_change_filter(int type) { switch (type) { case RBoxFilter: diff --git a/wrlib/scale.h b/wrlib/scale.h new file mode 100644 index 00000000..887b47d6 --- /dev/null +++ b/wrlib/scale.h @@ -0,0 +1,30 @@ +/* + * Raster graphics library + * + * Copyright (c) 2014 Window Maker Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library. + */ + +#ifndef WRASTER_SCALE_H +#define WRASTER_SCALE_H + + +/* + * Function to change the smoothing filter used for image scaling (RSmoothScaleImage) + */ +void wraster_change_filter(int type); + + +#endif diff --git a/wrlib/xutil.c b/wrlib/xutil.c index 3baa861d..1c3f86dc 100644 --- a/wrlib/xutil.c +++ b/wrlib/xutil.c @@ -36,6 +36,7 @@ #endif /* USE_XSHM */ #include "wraster.h" +#include "xutil.h" #ifdef USE_XSHM diff --git a/wrlib/xutil.h b/wrlib/xutil.h new file mode 100644 index 00000000..46b148b9 --- /dev/null +++ b/wrlib/xutil.h @@ -0,0 +1,29 @@ +/* + * Raster graphics library + * + * Copyright (c) 2014 Window Maker Team + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library. + */ + +#ifndef WRASTER_XUTIL_H +#define WRASTER_XUTIL_H + + +#ifdef USE_XSHM +Pixmap R_CreateXImageMappedPixmap(RContext *context, RXImage *ximage); +#endif + + +#endif