diff options
author | Kim Woelders <kim@woelders.dk> | 2021-11-07 16:11:14 +0100 |
---|---|---|
committer | Kim Woelders <kim@woelders.dk> | 2021-11-23 20:07:56 +0100 |
commit | 59d6b148f56f689e76ae70ba0735b90675c9b778 (patch) | |
tree | 737cb55c80a1bf19d61c234302a208e2041d7dbc | |
parent | 601cdb4d0d0fb7b5f2dc596e5ee3d211d82a90b6 (diff) | |
download | imlib2-59d6b148f56f689e76ae70ba0735b90675c9b778.tar.gz |
Rename X11 related files for clarity
And only build them when BUILD_X11.
-rw-r--r-- | src/lib/Makefile.am | 70 | ||||
-rw-r--r-- | src/lib/api.c | 10 | ||||
-rw-r--r-- | src/lib/x11_color.c (renamed from src/lib/color.c) | 7 | ||||
-rw-r--r-- | src/lib/x11_color.h (renamed from src/lib/color.h) | 10 | ||||
-rw-r--r-- | src/lib/x11_context.c (renamed from src/lib/context.c) | 11 | ||||
-rw-r--r-- | src/lib/x11_context.h (renamed from src/lib/context.h) | 6 | ||||
-rw-r--r-- | src/lib/x11_draw.c (renamed from src/lib/draw.c) | 8 | ||||
-rw-r--r-- | src/lib/x11_draw.h (renamed from src/lib/draw.h) | 6 | ||||
-rw-r--r-- | src/lib/x11_grab.c (renamed from src/lib/grab.c) | 8 | ||||
-rw-r--r-- | src/lib/x11_grab.h (renamed from src/lib/grab.h) | 6 | ||||
-rw-r--r-- | src/lib/x11_rend.c (renamed from src/lib/rend.c) | 16 | ||||
-rw-r--r-- | src/lib/x11_rend.h (renamed from src/lib/rend.h) | 6 | ||||
-rw-r--r-- | src/lib/x11_rgba.c (renamed from src/lib/rgba.c) | 8 | ||||
-rw-r--r-- | src/lib/x11_rgba.h (renamed from src/lib/rgba.h) | 6 | ||||
-rw-r--r-- | src/lib/x11_ximage.c (renamed from src/lib/ximage.c) | 6 | ||||
-rw-r--r-- | src/lib/x11_ximage.h (renamed from src/lib/ximage.h) | 6 |
16 files changed, 76 insertions, 114 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 340249e..73a7528 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -14,64 +14,34 @@ include_HEADERS = Imlib2.h libImlib2_la_SOURCES = \ api.c \ asm.h \ -blend.c \ -blend.h \ -color.c \ -color.h \ -color_helpers.c \ -color_helpers.h \ -colormod.c \ -colormod.h \ +blend.c blend.h \ +color_helpers.c color_helpers.h \ +colormod.c colormod.h \ common.h \ -context.c \ -context.h \ -debug.c \ -debug.h \ -draw.c \ -draw.h \ -dynamic_filters.c \ -dynamic_filters.h \ +debug.c debug.h \ +dynamic_filters.c dynamic_filters.h \ ellipse.c \ -file.c \ -file.h \ -filter.c \ -filter.h \ +file.c file.h \ +filter.c filter.h \ font.h \ font_draw.c \ font_load.c \ font_main.c \ font_query.c \ -grab.c \ -grab.h \ -grad.c \ -grad.h \ -image.c \ -image.h \ +grad.c grad.h \ +image.c image.h \ image_tags.c \ line.c \ -loaders.c \ -loaders.h \ +loaders.c loaders.h \ modules.c \ polygon.c \ rectangle.c \ -rend.c \ -rend.h \ -rgba.c \ -rgba.h \ -rgbadraw.c \ -rgbadraw.h \ -rotate.c \ -rotate.h \ -scale.c \ -scale.h \ -script.c \ -script.h \ -span.c \ -span.h \ -updates.c \ -updates.h \ -ximage.c \ -ximage.h +rgbadraw.c rgbadraw.h \ +rotate.c rotate.h \ +scale.c scale.h \ +script.c script.h \ +span.c span.h \ +updates.c updates.h MMX_SRCS = \ asm_blend.S \ @@ -91,6 +61,14 @@ EXTRA_DIST = $(MMX_SRCS) $(AMD64_SRCS) asm_loadimmq.S MY_LIBS = $(FREETYPE_LIBS) $(DLOPEN_LIBS) -lm if BUILD_X11 +libImlib2_la_SOURCES += \ +x11_color.c x11_color.h \ +x11_context.c x11_context.h \ +x11_draw.c x11_draw.h \ +x11_grab.c x11_grab.h \ +x11_rend.c x11_rend.h \ +x11_rgba.c x11_rgba.h \ +x11_ximage.c x11_ximage.h MY_LIBS += -lXext -lX11 @X_SHM_FD_LIBS@ endif if BUILD_DEBUG diff --git a/src/lib/api.c b/src/lib/api.c index a840d87..db042b2 100644 --- a/src/lib/api.c +++ b/src/lib/api.c @@ -27,11 +27,11 @@ #include "span.h" #include "updates.h" #ifdef BUILD_X11 -#include "color.h" -#include "draw.h" -#include "grab.h" -#include "rend.h" -#include "ximage.h" +#include "x11_color.h" +#include "x11_draw.h" +#include "x11_grab.h" +#include "x11_rend.h" +#include "x11_ximage.h" #endif /* convenience macros */ diff --git a/src/lib/color.c b/src/lib/x11_color.c index 3fecbda..37cde3a 100644 --- a/src/lib/color.c +++ b/src/lib/x11_color.c @@ -1,8 +1,9 @@ #include "common.h" -#ifdef BUILD_X11 + #include <X11/Xlib.h> #include <X11/Xutil.h> -#include "color.h" + +#include "x11_color.h" DATA8 _pal_type = 0; DATA16 _max_colors = 256; @@ -549,5 +550,3 @@ __imlib_AllocColors1(Display * d, Colormap cmap, Visual * v) _pal_type = 6; return color_lut; } - -#endif /* BUILD_X11 */ diff --git a/src/lib/color.h b/src/lib/x11_color.h index 9a1bcf0..5cdcbb8 100644 --- a/src/lib/color.h +++ b/src/lib/x11_color.h @@ -1,10 +1,8 @@ -#ifndef __COLOR -#define __COLOR 1 +#ifndef X11_COLOR_H +#define X11_COLOR_H 1 #include "common.h" -#ifdef BUILD_X11 - extern DATA16 _max_colors; int __imlib_XActualDepth(Display * d, Visual * v); @@ -29,6 +27,4 @@ DATA8 *__imlib_AllocColors111(Display * d, Colormap cmap, DATA8 *__imlib_AllocColors1(Display * d, Colormap cmap, Visual * v); -#endif - -#endif +#endif /* X11_COLOR_H */ diff --git a/src/lib/context.c b/src/lib/x11_context.c index 63deb42..0a70225 100644 --- a/src/lib/context.c +++ b/src/lib/x11_context.c @@ -1,10 +1,11 @@ #include "common.h" -#ifdef BUILD_X11 + #include <X11/Xlib.h> -#include "color.h" -#include "context.h" + #include "image.h" -#include "rgba.h" +#include "x11_color.h" +#include "x11_context.h" +#include "x11_rgba.h" static Context *context = NULL; static int max_context_count = 128; @@ -160,5 +161,3 @@ __imlib_GetContext(Display * d, Visual * v, Colormap c, int depth) return ct; } - -#endif /* BUILD_X11 */ diff --git a/src/lib/context.h b/src/lib/x11_context.h index fb19aa3..6bd0006 100644 --- a/src/lib/context.h +++ b/src/lib/x11_context.h @@ -1,5 +1,5 @@ -#ifndef __CONTEXT -#define __CONTEXT 1 +#ifndef X11_CONTEXT_H +#define X11_CONTEXT_H 1 #include "common.h" @@ -30,4 +30,4 @@ Context *__imlib_NewContext(Display * d, Visual * v, Colormap c, Context *__imlib_GetContext(Display * d, Visual * v, Colormap c, int depth); -#endif +#endif /* X11_CONTEXT_H */ diff --git a/src/lib/draw.c b/src/lib/x11_draw.c index 2dd3c10..6735918 100644 --- a/src/lib/draw.c +++ b/src/lib/x11_draw.c @@ -1,13 +1,13 @@ #include "common.h" -#ifdef BUILD_X11 + #include <X11/Xlib.h> #include <X11/extensions/XShm.h> #include "blend.h" #include "colormod.h" -#include "draw.h" #include "image.h" -#include "rend.h" +#include "x11_draw.h" +#include "x11_rend.h" char __imlib_CreatePixmapsForImage(Display * d, Drawable w, Visual * v, int depth, @@ -88,5 +88,3 @@ __imlib_CreatePixmapsForImage(Display * d, Drawable w, Visual * v, int depth, #endif return 1; } - -#endif /* BUILD_X11 */ diff --git a/src/lib/draw.h b/src/lib/x11_draw.h index 8ce0ac4..09305ee 100644 --- a/src/lib/draw.h +++ b/src/lib/x11_draw.h @@ -1,5 +1,5 @@ -#ifndef __DRAW -#define __DRAW 1 +#ifndef X11_DRAW_H +#define X11_DRAW_H 1 #include "colormod.h" #include "common.h" @@ -14,4 +14,4 @@ char __imlib_CreatePixmapsForImage(Display * d, Drawable w, char dither_mask, int mat, ImlibColorModifier * cmod); -#endif +#endif /* X11_DRAW_H */ diff --git a/src/lib/grab.c b/src/lib/x11_grab.c index 3e41351..90d03dd 100644 --- a/src/lib/grab.c +++ b/src/lib/x11_grab.c @@ -1,5 +1,5 @@ #include "common.h" -#ifdef BUILD_X11 + #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/extensions/shape.h> @@ -7,8 +7,8 @@ #include <sys/ipc.h> #include <sys/shm.h> -#include "grab.h" -#include "ximage.h" +#include "x11_grab.h" +#include "x11_ximage.h" static char _x_err = 0; static DATA8 rtab[256], gtab[256], btab[256]; @@ -829,5 +829,3 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, int ow, int oh, return 1; } - -#endif /* BUILD_X11 */ diff --git a/src/lib/grab.h b/src/lib/x11_grab.h index cf4086a..d2099d0 100644 --- a/src/lib/grab.h +++ b/src/lib/x11_grab.h @@ -1,5 +1,5 @@ -#ifndef __GRAB -#define __GRAB 1 +#ifndef X11_GRAB_H +#define X11_GRAB_H 1 #include "common.h" @@ -15,4 +15,4 @@ void __imlib_GrabXImageToRGBA(DATA32 * data, int ox, int oy, Visual * v, int depth, int x, int y, int w, int h, char grab); -#endif +#endif /* X11_GRAB_H */ diff --git a/src/lib/rend.c b/src/lib/x11_rend.c index 03fe3b9..b9e3402 100644 --- a/src/lib/rend.c +++ b/src/lib/x11_rend.c @@ -1,20 +1,20 @@ #include "common.h" -#ifdef BUILD_X11 + #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/extensions/XShm.h> #include "blend.h" -#include "color.h" #include "colormod.h" -#include "context.h" -#include "grab.h" #include "image.h" -#include "rend.h" -#include "rgba.h" #include "rotate.h" #include "scale.h" -#include "ximage.h" +#include "x11_color.h" +#include "x11_context.h" +#include "x11_grab.h" +#include "x11_rend.h" +#include "x11_rgba.h" +#include "x11_ximage.h" /* size of the lines per segment we scale / render at a time */ #define LINESIZE 16 @@ -592,5 +592,3 @@ __imlib_RenderImageSkewed(Display * d, ImlibImage * im, Drawable w, Drawable m, OP_COPY); __imlib_FreeImage(back); } - -#endif /* BUILD_X11 */ diff --git a/src/lib/rend.h b/src/lib/x11_rend.h index 2a68c46..36fde69 100644 --- a/src/lib/rend.h +++ b/src/lib/x11_rend.h @@ -1,5 +1,5 @@ -#ifndef __REND -#define __REND 1 +#ifndef X11_REND_H +#define X11_REND_H 1 #include "common.h" @@ -30,4 +30,4 @@ void __imlib_RenderImageSkewed(Display * d, ImlibImage * im, ImlibColorModifier * cmod, ImlibOp op); -#endif +#endif /* X11_REND_H */ diff --git a/src/lib/rgba.c b/src/lib/x11_rgba.c index 9337636..e2e8d65 100644 --- a/src/lib/rgba.c +++ b/src/lib/x11_rgba.c @@ -1,9 +1,9 @@ #include "common.h" -#ifdef BUILD_X11 + #include <X11/Xlib.h> -#include "context.h" -#include "rgba.h" +#include "x11_context.h" +#include "x11_rgba.h" #define IS_ALIGNED_128(val) (!((val) & 0x15)) #define IS_ALIGNED_64(val) (!((val) & 0x7)) @@ -4911,5 +4911,3 @@ __imlib_GetMaskFunction(char hiq) { return hiq ? &__imlib_RGBA_to_A1_dither : &__imlib_RGBA_to_A1_fast; } - -#endif /* BUILD_X11 */ diff --git a/src/lib/rgba.h b/src/lib/x11_rgba.h index 1b87dd2..c755850 100644 --- a/src/lib/rgba.h +++ b/src/lib/x11_rgba.h @@ -1,5 +1,5 @@ -#ifndef __RGBA -#define __RGBA 1 +#ifndef X11_RGBA_H +#define X11_RGBA_H 1 #include "common.h" @@ -32,4 +32,4 @@ void __imlib_mmx_bgr565_fast(DATA32 *, int, DATA8 *, int, int, int, int, int); #endif -#endif +#endif /* X11_RGBA_H */ diff --git a/src/lib/ximage.c b/src/lib/x11_ximage.c index eacd89a..f271bf7 100644 --- a/src/lib/ximage.c +++ b/src/lib/x11_ximage.c @@ -1,5 +1,5 @@ #include "common.h" -#ifdef BUILD_X11 + #include <X11/Xlib.h> #include <X11/extensions/XShm.h> #include <X11/Xutil.h> @@ -11,7 +11,7 @@ #include <sys/ipc.h> #include <sys/shm.h> -#include "ximage.h" +#include "x11_ximage.h" static signed char x_does_shm = -1; @@ -472,5 +472,3 @@ __imlib_ProduceXImage(Display * d, Visual * v, int depth, int w, int h, /* return out image */ return xim; } - -#endif /* BUILD_X11 */ diff --git a/src/lib/ximage.h b/src/lib/x11_ximage.h index e6fe8b6..fef27dc 100644 --- a/src/lib/ximage.h +++ b/src/lib/x11_ximage.h @@ -1,5 +1,5 @@ -#ifndef __XIMAGE -#define __XIMAGE 1 +#ifndef X11_XIMAGE_H +#define X11_XIMAGE_H 1 #include <X11/Xlib.h> #include <X11/extensions/XShm.h> @@ -22,4 +22,4 @@ XImage *__imlib_ShmGetXImage(Display * d, Visual * v, Drawable draw, void __imlib_ShmDestroyXImage(Display * d, XImage * xim, XShmSegmentInfo * si); -#endif +#endif /* X11_XIMAGE_H */ |