diff options
author | Kim Woelders <kim@woelders.dk> | 2008-10-26 13:59:07 +0000 |
---|---|---|
committer | Kim Woelders <kim@woelders.dk> | 2008-10-26 13:59:07 +0000 |
commit | 29442b80f57534e8e82dc8270a6a26a241caaef2 (patch) | |
tree | 10a2460f2b3927f0edd05994dd19bc09a1f8f11a | |
parent | e3ec99354e66eeec73a5764660337d4959c7ffae (diff) | |
download | imlib2-29442b80f57534e8e82dc8270a6a26a241caaef2.tar.gz |
Remove redundant BUILD_X11 tests, indent.
SVN revision: 37145
-rw-r--r-- | src/lib/color.c | 5 | ||||
-rw-r--r-- | src/lib/color.h | 34 | ||||
-rw-r--r-- | src/lib/context.c | 5 | ||||
-rw-r--r-- | src/lib/context.h | 52 | ||||
-rw-r--r-- | src/lib/draw.c | 5 | ||||
-rw-r--r-- | src/lib/draw.h | 20 | ||||
-rw-r--r-- | src/lib/grab.c | 17 | ||||
-rw-r--r-- | src/lib/grab.h | 25 | ||||
-rw-r--r-- | src/lib/rend.c | 5 | ||||
-rw-r--r-- | src/lib/rend.h | 47 | ||||
-rw-r--r-- | src/lib/rgba.c | 9 | ||||
-rw-r--r-- | src/lib/rgba.h | 41 | ||||
-rw-r--r-- | src/lib/ximage.c | 17 | ||||
-rw-r--r-- | src/lib/ximage.h | 19 |
14 files changed, 139 insertions, 162 deletions
diff --git a/src/lib/color.c b/src/lib/color.c index 92e72f0..9f6fb2e 100644 --- a/src/lib/color.c +++ b/src/lib/color.c @@ -3,9 +3,6 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> #include "color.h" -#endif - -#ifdef BUILD_X11 DATA8 _pal_type = 0; DATA16 _max_colors = 256; @@ -552,4 +549,4 @@ __imlib_AllocColors1(Display * d, Colormap cmap, Visual * v) return color_lut; } -#endif +#endif /* BUILD_X11 */ diff --git a/src/lib/color.h b/src/lib/color.h index a55ac6f..3905c75 100644 --- a/src/lib/color.h +++ b/src/lib/color.h @@ -3,19 +3,29 @@ #ifdef BUILD_X11 -extern DATA16 _max_colors; +extern DATA16 _max_colors; -__hidden int __imlib_XActualDepth(Display *d, Visual *v); -__hidden Visual *__imlib_BestVisual(Display *d, int screen, int *depth_return); -__hidden DATA8 * __imlib_AllocColorTable(Display *d, Colormap cmap, DATA8 *type_return, Visual *v); -__hidden DATA8 * __imlib_AllocColors332(Display *d, Colormap cmap, Visual *v); -__hidden DATA8 * __imlib_AllocColors666(Display *d, Colormap cmap, Visual *v); -__hidden DATA8 * __imlib_AllocColors232(Display *d, Colormap cmap, Visual *v); -__hidden DATA8 * __imlib_AllocColors222(Display *d, Colormap cmap, Visual *v); -__hidden DATA8 * __imlib_AllocColors221(Display *d, Colormap cmap, Visual *v); -__hidden DATA8 * __imlib_AllocColors121(Display *d, Colormap cmap, Visual *v); -__hidden DATA8 * __imlib_AllocColors111(Display *d, Colormap cmap, Visual *v); -__hidden DATA8 * __imlib_AllocColors1(Display *d, Colormap cmap, Visual *v); +__hidden int __imlib_XActualDepth(Display * d, Visual * v); +__hidden Visual *__imlib_BestVisual(Display * d, int screen, + int *depth_return); +__hidden DATA8 *__imlib_AllocColorTable(Display * d, Colormap cmap, + DATA8 * type_return, Visual * v); +__hidden DATA8 *__imlib_AllocColors332(Display * d, Colormap cmap, + Visual * v); +__hidden DATA8 *__imlib_AllocColors666(Display * d, Colormap cmap, + Visual * v); +__hidden DATA8 *__imlib_AllocColors232(Display * d, Colormap cmap, + Visual * v); +__hidden DATA8 *__imlib_AllocColors222(Display * d, Colormap cmap, + Visual * v); +__hidden DATA8 *__imlib_AllocColors221(Display * d, Colormap cmap, + Visual * v); +__hidden DATA8 *__imlib_AllocColors121(Display * d, Colormap cmap, + Visual * v); +__hidden DATA8 *__imlib_AllocColors111(Display * d, Colormap cmap, + Visual * v); +__hidden DATA8 *__imlib_AllocColors1(Display * d, Colormap cmap, + Visual * v); #endif diff --git a/src/lib/context.c b/src/lib/context.c index a0b5794..1c9850b 100644 --- a/src/lib/context.c +++ b/src/lib/context.c @@ -1,14 +1,11 @@ #include "common.h" #ifdef BUILD_X11 #include <X11/Xlib.h> -#endif #include "image.h" #include "context.h" #include "color.h" #include "rgba.h" -#ifdef BUILD_X11 - static Context *context = NULL; static int max_context_count = 128; static int context_counter = 0; @@ -209,4 +206,4 @@ __imlib_GetContext(Display * d, Visual * v, Colormap c, int depth) return ct; } -#endif +#endif /* BUILD_X11 */ diff --git a/src/lib/context.h b/src/lib/context.h index b557285..d632902 100644 --- a/src/lib/context.h +++ b/src/lib/context.h @@ -1,36 +1,34 @@ #ifndef __CONTEXT #define __CONTEXT 1 -#ifdef BUILD_X11 - typedef struct _context Context; -struct _context -{ - int last_use; - Display *display; - Visual *visual; - Colormap colormap; - int depth; - Context *next; - - DATA8 *palette; - DATA8 palette_type; - void *r_dither; - void *g_dither; - void *b_dither; -}; +struct _context { + int last_use; + Display *display; + Visual *visual; + Colormap colormap; + int depth; + Context *next; -__hidden void __imlib_SetMaxContexts(int num); -__hidden int __imlib_GetMaxContexts(void); -__hidden void __imlib_FlushContexts(void); -__hidden void __imlib_FreeContextForDisplay(Display *d); -__hidden void __imlib_FreeContextForColormap(Display *d, Colormap cm); -__hidden void __imlib_FreeContextForVisual(Display *d, Visual *v); -__hidden Context *__imlib_FindContext(Display *d, Visual *v, Colormap c, int depth); -__hidden Context *__imlib_NewContext(Display *d, Visual *v, Colormap c, int depth); -__hidden Context *__imlib_GetContext(Display *d, Visual *v, Colormap c, int depth); + DATA8 *palette; + DATA8 palette_type; + void *r_dither; + void *g_dither; + void *b_dither; +}; -#endif +__hidden void __imlib_SetMaxContexts(int num); +__hidden int __imlib_GetMaxContexts(void); +__hidden void __imlib_FlushContexts(void); +__hidden void __imlib_FreeContextForDisplay(Display * d); +__hidden void __imlib_FreeContextForColormap(Display * d, Colormap cm); +__hidden void __imlib_FreeContextForVisual(Display * d, Visual * v); +__hidden Context *__imlib_FindContext(Display * d, Visual * v, Colormap c, + int depth); +__hidden Context *__imlib_NewContext(Display * d, Visual * v, Colormap c, + int depth); +__hidden Context *__imlib_GetContext(Display * d, Visual * v, Colormap c, + int depth); #endif diff --git a/src/lib/draw.c b/src/lib/draw.c index 4865fc6..04d3bfe 100644 --- a/src/lib/draw.c +++ b/src/lib/draw.c @@ -2,15 +2,12 @@ #ifdef BUILD_X11 #include <X11/Xlib.h> #include <X11/extensions/XShm.h> -#endif #include "colormod.h" #include "image.h" #include "blend.h" #include "rend.h" #include "draw.h" -#ifdef BUILD_X11 - char __imlib_CreatePixmapsForImage(Display * d, Drawable w, Visual * v, int depth, Colormap cm, ImlibImage * im, Pixmap * p, @@ -91,4 +88,4 @@ __imlib_CreatePixmapsForImage(Display * d, Drawable w, Visual * v, int depth, return 1; } -#endif +#endif /* BUILD_X11 */ diff --git a/src/lib/draw.h b/src/lib/draw.h index 8f80163..392e546 100644 --- a/src/lib/draw.h +++ b/src/lib/draw.h @@ -1,16 +1,14 @@ #ifndef __DRAW #define __DRAW 1 -#ifdef BUILD_X11 - -__hidden char -__imlib_CreatePixmapsForImage(Display *d, Drawable w, Visual *v, int depth, - Colormap cm, ImlibImage *im, Pixmap *p, Mask *m, - int sx, int sy, int sw, int sh, - int dw, int dh, - char anitalias, char hiq, char dither_mask, - int mat, ImlibColorModifier *cmod); - -#endif +__hidden char __imlib_CreatePixmapsForImage(Display * d, Drawable w, + Visual * v, int depth, + Colormap cm, ImlibImage * im, + Pixmap * p, Mask * m, int sx, + int sy, int sw, int sh, + int dw, int dh, + char anitalias, char hiq, + char dither_mask, int mat, + ImlibColorModifier * cmod); #endif diff --git a/src/lib/grab.c b/src/lib/grab.c index 4098f0a..d38218f 100644 --- a/src/lib/grab.c +++ b/src/lib/grab.c @@ -1,16 +1,13 @@ #include "common.h" #ifdef BUILD_X11 -# include <X11/Xlib.h> -# include <X11/extensions/XShm.h> -# include <X11/Xutil.h> -# include <X11/extensions/shape.h> -# include <sys/ipc.h> -# include <sys/shm.h> -#endif +#include <X11/Xlib.h> +#include <X11/extensions/XShm.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +#include <sys/ipc.h> +#include <sys/shm.h> #include "grab.h" -#ifdef BUILD_X11 - static char _x_err = 0; static DATA8 rtab[256], gtab[256], btab[256]; @@ -868,4 +865,4 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, int ow, int oh, return 1; } -#endif +#endif /* BUILD_X11 */ diff --git a/src/lib/grab.h b/src/lib/grab.h index 2116163..3db405e 100644 --- a/src/lib/grab.h +++ b/src/lib/grab.h @@ -1,19 +1,16 @@ #ifndef __GRAB #define __GRAB 1 -#ifdef BUILD_X11 - -__hidden char -__imlib_GrabDrawableToRGBA(DATA32 *data, int ox, int oy, int ow, int oh, - Display *d, Drawable p, Pixmap m, Visual *v, - Colormap cm, int depth, int x, int y, - int w, int h, char *domask, char grab); -__hidden void -__imlib_GrabXImageToRGBA(DATA32 *data, int ox, int oy, int ow, int oh, - Display *d, XImage *xim, XImage *mxim, Visual *v, - int depth, int x, int y, - int w, int h, char grab); - -#endif +__hidden char __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, + int ow, int oh, Display * d, + Drawable p, Pixmap m, Visual * v, + Colormap cm, int depth, int x, + int y, int w, int h, + char *domask, char grab); +__hidden void __imlib_GrabXImageToRGBA(DATA32 * data, int ox, int oy, + int ow, int oh, Display * d, + XImage * xim, XImage * mxim, + Visual * v, int depth, int x, + int y, int w, int h, char grab); #endif diff --git a/src/lib/rend.c b/src/lib/rend.c index dc6edf5..b008f6d 100644 --- a/src/lib/rend.c +++ b/src/lib/rend.c @@ -3,7 +3,6 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/extensions/XShm.h> -#endif #include "colormod.h" #include "image.h" #include "scale.h" @@ -16,8 +15,6 @@ #include "rend.h" #include "rotate.h" -#ifdef BUILD_X11 - /* size of the lines per segment we scale / render at a time */ #define LINESIZE 16 @@ -601,4 +598,4 @@ __imlib_RenderImageSkewed(Display * d, ImlibImage * im, Drawable w, Drawable m, __imlib_FreeImage(back); } -#endif +#endif /* BUILD_X11 */ diff --git a/src/lib/rend.h b/src/lib/rend.h index c16fd46..82a0d18 100644 --- a/src/lib/rend.h +++ b/src/lib/rend.h @@ -1,32 +1,31 @@ #ifndef __REND #define __REND 1 -#ifdef BUILD_X11 +__hidden DATA32 __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, + Colormap cm, int depth, DATA8 r, + DATA8 g, DATA8 b); -__hidden DATA32 -__imlib_RenderGetPixel(Display *d, Drawable w, Visual *v, Colormap cm, int depth, DATA8 r, DATA8 g, DATA8 b); +__hidden void __imlib_RenderDisconnect(Display * d); -__hidden void -__imlib_RenderDisconnect(Display *d); +__hidden void __imlib_RenderImage(Display * d, ImlibImage * im, + Drawable w, Drawable m, + Visual * v, Colormap cm, int depth, + int sx, int sy, int sw, int sh, + int dx, int dy, int dw, int dh, + char anitalias, char hiq, char blend, + char dither_mask, int mat, + ImlibColorModifier * cmod, ImlibOp op); -__hidden void -__imlib_RenderImage(Display *d, ImlibImage *im, - Drawable w, Drawable m, - Visual *v, Colormap cm, int depth, - int sx, int sy, int sw, int sh, - int dx, int dy, int dw, int dh, - char anitalias, char hiq, char blend, char dither_mask, - int mat, ImlibColorModifier *cmod, ImlibOp op); - -__hidden void -__imlib_RenderImageSkewed(Display *d, ImlibImage *im, Drawable w, - Drawable m, Visual *v, Colormap cm, int depth, - int sx, int sy, int sw, int sh, int dx, int dy, - int hsx, int hsy, int vsx, int vsy, - char antialias, char hiq, char blend, - char dither_mask, int mat, ImlibColorModifier *cmod, - ImlibOp op); - -#endif +__hidden void __imlib_RenderImageSkewed(Display * d, ImlibImage * im, + Drawable w, Drawable m, + Visual * v, Colormap cm, + int depth, int sx, int sy, int sw, + int sh, int dx, int dy, int hsx, + int hsy, int vsx, int vsy, + char antialias, char hiq, + char blend, char dither_mask, + int mat, + ImlibColorModifier * cmod, + ImlibOp op); #endif diff --git a/src/lib/rgba.c b/src/lib/rgba.c index 6da6498..b05140b 100644 --- a/src/lib/rgba.c +++ b/src/lib/rgba.c @@ -1,12 +1,9 @@ #include "common.h" #ifdef BUILD_X11 -# include <X11/Xlib.h> -# include "context.h" -#endif +#include <X11/Xlib.h> +#include "context.h" #include "rgba.h" -#ifdef BUILD_X11 - #define IS_ALIGNED_128(val) (!((val) & 0x15)) #define IS_ALIGNED_64(val) (!((val) & 0x7)) #define IS_ALIGNED_32(val) (!((val) & 0x3)) @@ -4998,4 +4995,4 @@ __imlib_GetMaskFunction(char hiq) return hiq ? &__imlib_RGBA_to_A1_dither : &__imlib_RGBA_to_A1_fast; } -#endif +#endif /* BUILD_X11 */ diff --git a/src/lib/rgba.h b/src/lib/rgba.h index 00087c4..e67a365 100644 --- a/src/lib/rgba.h +++ b/src/lib/rgba.h @@ -1,35 +1,34 @@ #ifndef __RGBA #define __RGBA 1 -#ifdef BUILD_X11 - #define DM_BS1 (8 + 3) #define DM_BS2 (8) #define DM_X (8) #define DM_Y (8) -__hidden void __imlib_RGBASetupContext(Context *ct); -__hidden void __imlib_RGBA_init(void *rd, void *gd, void *bd, int depth, - DATA8 palette_type); +__hidden void __imlib_RGBASetupContext(Context * ct); +__hidden void __imlib_RGBA_init(void *rd, void *gd, void *bd, int depth, + DATA8 palette_type); -typedef void (*ImlibRGBAFunction)(DATA32*, int, DATA8*, - int, int, int, int, int); -typedef void (*ImlibMaskFunction)(DATA32*, int, DATA8*, - int, int, int, int, int, int); -__hidden ImlibRGBAFunction -__imlib_GetRGBAFunction(int depth, - unsigned long rm, unsigned long gm, unsigned long bm, - char hiq, DATA8 palette_type); -__hidden ImlibMaskFunction -__imlib_GetMaskFunction(char hiq); +typedef void (*ImlibRGBAFunction) (DATA32 *, int, DATA8 *, + int, int, int, int, int); +typedef void (*ImlibMaskFunction) (DATA32 *, int, DATA8 *, + int, int, int, int, int, int); +__hidden ImlibRGBAFunction +__imlib_GetRGBAFunction(int depth, + unsigned long rm, unsigned long gm, unsigned long bm, + char hiq, DATA8 palette_type); +__hidden ImlibMaskFunction __imlib_GetMaskFunction(char hiq); #ifdef DO_MMX_ASM -void __imlib_mmx_rgb555_fast(DATA32*, int, DATA8*, int, int, int, int, int); -void __imlib_mmx_bgr555_fast(DATA32*, int, DATA8*, int, int, int, int, int); -void __imlib_mmx_rgb565_fast(DATA32*, int, DATA8*, int, int, int, int, int); -void __imlib_mmx_bgr565_fast(DATA32*, int, DATA8*, int, int, int, int, int); -#endif - +void __imlib_mmx_rgb555_fast(DATA32 *, int, DATA8 *, int, int, + int, int, int); +void __imlib_mmx_bgr555_fast(DATA32 *, int, DATA8 *, int, int, + int, int, int); +void __imlib_mmx_rgb565_fast(DATA32 *, int, DATA8 *, int, int, + int, int, int); +void __imlib_mmx_bgr565_fast(DATA32 *, int, DATA8 *, int, int, + int, int, int); #endif #endif diff --git a/src/lib/ximage.c b/src/lib/ximage.c index 00c3106..230e5b0 100644 --- a/src/lib/ximage.c +++ b/src/lib/ximage.c @@ -1,14 +1,11 @@ #include "common.h" #ifdef BUILD_X11 -# include <X11/Xlib.h> -# include <X11/extensions/XShm.h> -# include <X11/Xutil.h> -# include <sys/ipc.h> -# include <sys/shm.h> -# include "ximage.h" -#endif - -#ifdef BUILD_X11 +#include <X11/Xlib.h> +#include <X11/extensions/XShm.h> +#include <X11/Xutil.h> +#include <sys/ipc.h> +#include <sys/shm.h> +#include "ximage.h" /* static private variables */ static signed char x_does_shm = -1; @@ -363,4 +360,4 @@ __imlib_ProduceXImage(Display * d, Visual * v, int depth, int w, int h, return xim; } -#endif +#endif /* BUILD_X11 */ diff --git a/src/lib/ximage.h b/src/lib/ximage.h index 8a543e3..c1fc7ef 100644 --- a/src/lib/ximage.h +++ b/src/lib/ximage.h @@ -1,16 +1,13 @@ #ifndef __XIMAGE #define __XIMAGE 1 -#ifdef BUILD_X11 - -void __imlib_SetMaxXImageCount(Display *d, int num); -__hidden int __imlib_GetMaxXImageCount(Display *d); -__hidden void __imlib_SetMaxXImageTotalSize(Display *d, int num); -__hidden int __imlib_GetMaxXImageTotalSize(Display *d); -__hidden void __imlib_FlushXImage(Display *d); -__hidden void __imlib_ConsumeXImage(Display *d, XImage *xim); -__hidden XImage *__imlib_ProduceXImage(Display *d, Visual *v, int depth, int w, int h, char *shared); - -#endif +void __imlib_SetMaxXImageCount(Display * d, int num); +__hidden int __imlib_GetMaxXImageCount(Display * d); +__hidden void __imlib_SetMaxXImageTotalSize(Display * d, int num); +__hidden int __imlib_GetMaxXImageTotalSize(Display * d); +__hidden void __imlib_FlushXImage(Display * d); +__hidden void __imlib_ConsumeXImage(Display * d, XImage * xim); +__hidden XImage *__imlib_ProduceXImage(Display * d, Visual * v, int depth, + int w, int h, char *shared); #endif |