From 02c90dee47c45ade9a1046559a4c84f8e353fb87 Mon Sep 17 00:00:00 2001 From: deadwood Date: Tue, 25 Oct 2016 16:45:22 +0000 Subject: [PATCH] x11.hidd: clean up includes to fix build under linux-armhf git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@53031 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/all-hosted/hidd/x11/bitmap_common.c | 19 +++------- arch/all-hosted/hidd/x11/fullscreen.c | 10 +++--- arch/all-hosted/hidd/x11/offbitmap.c | 21 ++--------- arch/all-hosted/hidd/x11/onbitmap.c | 17 ++------- arch/all-hosted/hidd/x11/startup.c | 9 ++--- arch/all-hosted/hidd/x11/support.c | 11 ++---- arch/all-hosted/hidd/x11/x11.c | 39 +++------------------ arch/all-hosted/hidd/x11/x11.h | 60 ++++++++++++++++++++++++-------- arch/all-hosted/hidd/x11/x11_hostlib.c | 11 ++---- arch/all-hosted/hidd/x11/x11_hostlib.h | 7 ++-- arch/all-hosted/hidd/x11/x11_init.c | 21 ++--------- arch/all-hosted/hidd/x11/x11_types.h | 13 +++++++ arch/all-hosted/hidd/x11/x11clipboard.c | 44 +++-------------------- arch/all-hosted/hidd/x11/x11gfx.c | 34 +++--------------- arch/all-hosted/hidd/x11/x11gfx.conf | 4 +-- arch/all-hosted/hidd/x11/x11gfx_intern.h | 52 --------------------------- arch/all-hosted/hidd/x11/x11kbd.c | 29 ++++----------- arch/all-hosted/hidd/x11/x11mouse.c | 18 +++------- arch/all-hosted/hidd/x11/xshm.c | 18 ++++------ 19 files changed, 119 insertions(+), 318 deletions(-) create mode 100644 arch/all-hosted/hidd/x11/x11_types.h delete mode 100644 arch/all-hosted/hidd/x11/x11gfx_intern.h diff --git a/arch/all-hosted/hidd/x11/bitmap_common.c b/arch/all-hosted/hidd/x11/bitmap_common.c index 4866245c22..172407aca4 100644 --- a/arch/all-hosted/hidd/x11/bitmap_common.c +++ b/arch/all-hosted/hidd/x11/bitmap_common.c @@ -1,29 +1,18 @@ /* - Copyright © 1995-2014, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ */ #include "x11_debug.h" -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include -#include - -#include #include +#include "x11_types.h" #include "x11.h" +#include "x11_hostlib.h" #include "bitmap.h" -#include "x11gfx_intern.h" +#include "xshm.h" /****************************************************************************************/ diff --git a/arch/all-hosted/hidd/x11/fullscreen.c b/arch/all-hosted/hidd/x11/fullscreen.c index 39a5f2e5e8..17d6a83dce 100644 --- a/arch/all-hosted/hidd/x11/fullscreen.c +++ b/arch/all-hosted/hidd/x11/fullscreen.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2014, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: Enable fullscreen mode. @@ -7,18 +7,16 @@ */ #include -#include -#include +#include "x11_types.h" #if USE_VIDMODE -#include - #define __typedef_BYTE #define __typedef_BOOL typedef unsigned char UBYTE; -#include +#include + #define HAVE_XF86VMODE_H diff --git a/arch/all-hosted/hidd/x11/offbitmap.c b/arch/all-hosted/hidd/x11/offbitmap.c index 684cda0368..9cfd17ac6b 100644 --- a/arch/all-hosted/hidd/x11/offbitmap.c +++ b/arch/all-hosted/hidd/x11/offbitmap.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2014, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: Offscreen bitmap class for X11 hidd. @@ -10,27 +10,12 @@ #include "x11_debug.h" -#include -#include -#include -#include -#include -#include - -#include - -#include #include - -#include -#include -#include -#include -#include #include -#include "x11gfx_intern.h" +#include "x11_types.h" #include "x11.h" +#include "x11_hostlib.h" #include "bitmap.h" /****************************************************************************************/ diff --git a/arch/all-hosted/hidd/x11/onbitmap.c b/arch/all-hosted/hidd/x11/onbitmap.c index 85f5ad9a78..ffb8de54cb 100644 --- a/arch/all-hosted/hidd/x11/onbitmap.c +++ b/arch/all-hosted/hidd/x11/onbitmap.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2015, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: Bitmap class for X11 hidd. @@ -8,24 +8,13 @@ #include "x11_debug.h" -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include - -#include #include +#include "x11_types.h" #include "x11.h" +#include "x11_hostlib.h" #include "bitmap.h" -#include "x11gfx_intern.h" /****************************************************************************************/ diff --git a/arch/all-hosted/hidd/x11/startup.c b/arch/all-hosted/hidd/x11/startup.c index 3f1fa24e2d..926d53e165 100644 --- a/arch/all-hosted/hidd/x11/startup.c +++ b/arch/all-hosted/hidd/x11/startup.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2014, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ */ @@ -20,15 +20,12 @@ * open etc. */ -#include -#include -#include +#include "x11_debug.h" + #include #include #include -#include #include -#include #include LC_LIBDEFS_FILE diff --git a/arch/all-hosted/hidd/x11/support.c b/arch/all-hosted/hidd/x11/support.c index ae0a5302aa..0099342e54 100644 --- a/arch/all-hosted/hidd/x11/support.c +++ b/arch/all-hosted/hidd/x11/support.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2014, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: X11 gfx HIDD for AROS. @@ -8,19 +8,12 @@ #include "x11_debug.h" -#include #include -#include -#include -#include - -#include "x11gfx_intern.h" +#include "x11_types.h" #include "x11.h" -#include - /****************************************************************************************/ VOID Hidd_X11Mouse_HandleEvent(OOP_Object *o, XEvent *event) diff --git a/arch/all-hosted/hidd/x11/x11.c b/arch/all-hosted/hidd/x11/x11.c index 847c1ae24b..ca8b2a857d 100644 --- a/arch/all-hosted/hidd/x11/x11.c +++ b/arch/all-hosted/hidd/x11/x11.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2015, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: X11 hidd. Connects to the X server and receives events. @@ -8,46 +8,15 @@ #include "x11_debug.h" -#include -#include -#include - -#define size_t aros_size_t -#include - -#include - -#include - -#include -#include -#include -#include -#include #include -#include -#include -#undef size_t - -#define timeval sys_timevalinit_x11class -#include -#include -#include -#include -#include -#include -#include -#undef timeval - -#include -#include -#include #include +#include +#include "x11_types.h" #include "x11.h" +#include "x11_hostlib.h" #include "fullscreen.h" -#include "x11gfx_intern.h" VOID X11BM_ExposeFB(APTR data, WORD x, WORD y, WORD width, WORD height); diff --git a/arch/all-hosted/hidd/x11/x11.h b/arch/all-hosted/hidd/x11/x11.h index a7a9d9b534..f6e2f262cc 100644 --- a/arch/all-hosted/hidd/x11/x11.h +++ b/arch/all-hosted/hidd/x11/x11.h @@ -2,32 +2,55 @@ #define HIDD_X11_H /* - Copyright © 1995-2015, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: Include for the x11 HIDD. Lang: English. */ -#include -#include -#include +#include +#include #include -#include -#define timeval sys_timeval -#ifndef _XLIB_H_ -# include +#ifndef X11_TYPES_H +/* Note: x11_types.h is not included intentionally to resolve compilation + * issues on linux-armhf where certain definitions collide between AROS + * and Linux. + * In every source file x11_types.h needs to be included before to x11.h + */ +#include // Simple types definitions +typedef struct _XEvent XEvent; // Used only as pointer +typedef struct _Display Display; // Used only as pointer +typedef APTR GC; // GC is a pointer type + +typedef struct _Visual Visual; +typedef struct { + Visual *visual; + VisualID visualid; + int screen; + int depth; +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /* C++ */ +#else + int class; #endif - -#ifndef _XUTIL_H -# include + unsigned long red_mask; + unsigned long green_mask; + unsigned long blue_mask; + int colormap_size; + int bits_per_rgb; +} XVisualInfo; #endif -#undef timeval -#include "xshm.h" -#include "x11_hostlib.h" +/****************************************************************************************/ + +#define USE_X11_DRAWFUNCS 1 +#define X11SOFTMOUSE 1 /* Use software mouse sprite */ +#define ADJUST_XWIN_SIZE 1 /* Resize the xwindow to the size of the actual visible screen */ + +/****************************************************************************************/ /***** X11Mouse HIDD *******************/ @@ -227,6 +250,15 @@ struct x11clbase struct x11_staticdata xsd; }; +/* Private Attrs and methods for the X11Gfx Hidd */ + +#define CLID_Hidd_Gfx_X11 "hidd.gfx.x11" +#define IID_Hidd_Gfx_X11 "hidd.gfx.x11" + +#define PEN_BITS 4 +#define NUM_COLORS (1L << PEN_BITS) +#define PEN_MASK (NUM_COLORS - 1) + /* Private instance data for Gfx hidd class */ struct gfx_data { diff --git a/arch/all-hosted/hidd/x11/x11_hostlib.c b/arch/all-hosted/hidd/x11/x11_hostlib.c index 204d469694..5f04cf001f 100644 --- a/arch/all-hosted/hidd/x11/x11_hostlib.c +++ b/arch/all-hosted/hidd/x11/x11_hostlib.c @@ -1,20 +1,15 @@ /* - Copyright © 1995-2015, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ */ #include "x11_debug.h" -#include - -#include "x11gfx_intern.h" -#include "x11.h" - #include -#include - +#include "x11_types.h" #include LC_LIBDEFS_FILE +#include "x11_hostlib.h" void *x11_handle = NULL; void *libc_handle = NULL; diff --git a/arch/all-hosted/hidd/x11/x11_hostlib.h b/arch/all-hosted/hidd/x11/x11_hostlib.h index cd5e2700c8..b51aa64244 100644 --- a/arch/all-hosted/hidd/x11/x11_hostlib.h +++ b/arch/all-hosted/hidd/x11/x11_hostlib.h @@ -1,5 +1,5 @@ /* - Copyright © 1995-2015, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ */ @@ -7,12 +7,11 @@ #define X11_HOSTLIB_H #include - -#include +#include #if USE_XSHM -#include #include +#include #endif // Set to 1 if you want to disable the asynchronic nature of the X11 HIDD. diff --git a/arch/all-hosted/hidd/x11/x11_init.c b/arch/all-hosted/hidd/x11/x11_init.c index ed0f70c698..12a014808b 100644 --- a/arch/all-hosted/hidd/x11/x11_init.c +++ b/arch/all-hosted/hidd/x11/x11_init.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2014, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: X11 hidd initialization code. @@ -10,27 +10,12 @@ #define __OOP_NOATTRBASES__ -#include -#include -#include -#include - -#include - #include #include -#include -#include - -#include -#include -#include - -#include +#include "x11_types.h" #include LC_LIBDEFS_FILE - -#include "x11.h" +#include "x11_hostlib.h" #include "fullscreen.h" /****************************************************************************************/ diff --git a/arch/all-hosted/hidd/x11/x11_types.h b/arch/all-hosted/hidd/x11/x11_types.h new file mode 100644 index 0000000000..c5c31048bc --- /dev/null +++ b/arch/all-hosted/hidd/x11/x11_types.h @@ -0,0 +1,13 @@ +#ifndef X11_TYPES_H +#define X11_TYPES_H + +/* + Copyright © 2016, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#define timeval sys_timeval +#include +#undef timeval + +#endif diff --git a/arch/all-hosted/hidd/x11/x11clipboard.c b/arch/all-hosted/hidd/x11/x11clipboard.c index 9936d66f44..5e059c147b 100644 --- a/arch/all-hosted/hidd/x11/x11clipboard.c +++ b/arch/all-hosted/hidd/x11/x11clipboard.c @@ -1,54 +1,20 @@ /* - Copyright © 1995-2006, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: X11 hidd. Host clipboard support. Lang: English. */ +#include "x11_debug.h" #include -#include -#include - -#define size_t aros_size_t -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#undef size_t - -#define timeval sys_timeval -#include -#include -#include -#include -#include -#include -#include -#undef timeval - -#include -#include + #include +#include "x11_types.h" #include "x11.h" -#include "x11gfx_intern.h" - -#define DEBUG 0 -#include +#include "x11_hostlib.h" #undef XSD #define XSD(cl) xsd diff --git a/arch/all-hosted/hidd/x11/x11gfx.c b/arch/all-hosted/hidd/x11/x11gfx.c index fc3631d2ab..9168b78f6e 100644 --- a/arch/all-hosted/hidd/x11/x11gfx.c +++ b/arch/all-hosted/hidd/x11/x11gfx.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2015, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: X11 gfx HIDD for AROS. @@ -10,41 +10,17 @@ #define __OOP_NOATTRBASES__ -#include -#include -#include -#include +#include -#include #include -#include - #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include "bitmap_class.h" -#include "x11gfx_intern.h" -#include "x11.h" +#include "x11_types.h" #include LC_LIBDEFS_FILE +#include "x11_hostlib.h" +#include "xshm.h" #define XFLUSH(x) XCALL(XFlush, x) -//#define XFLUSH(x) /****************************************************************************************/ diff --git a/arch/all-hosted/hidd/x11/x11gfx.conf b/arch/all-hosted/hidd/x11/x11gfx.conf index 2ea3c49f15..0921d42f30 100644 --- a/arch/all-hosted/hidd/x11/x11gfx.conf +++ b/arch/all-hosted/hidd/x11/x11gfx.conf @@ -2,7 +2,7 @@ basename X11Cl libbase X11ClBase libbasetype struct x11clbase -version 42.1 +version 42.2 residentpri 9 classid CLID_Hidd_Gfx_X11 superclass CLID_Hidd_Gfx @@ -13,8 +13,6 @@ classdatatype struct gfx_data ##begin cdefprivate #include #include "x11.h" -#include "x11gfx_intern.h" -#include "bitmap_class.h" #include "bitmap.h" /* Avoid conflict with intuition and X11 definition of CurrentTime in the generated code */ diff --git a/arch/all-hosted/hidd/x11/x11gfx_intern.h b/arch/all-hosted/hidd/x11/x11gfx_intern.h deleted file mode 100644 index 0b542cecf0..0000000000 --- a/arch/all-hosted/hidd/x11/x11gfx_intern.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef X11GFX_INTERN_H -#define X11GFX_INTERN_H - -/* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. - $Id$ - - Desc: X11 gfx HIDD for AROS. - Lang: English. -*/ - -#ifndef EXEC_TYPES_H -# include -#endif -#ifndef EXEC_LIBRARIES_H -# include -#endif -#ifndef DOS_BPTR_H -# include -#endif -#ifndef OOP_OOP_H -# include -#endif - -#include - -#include "x11_class.h" - -/****************************************************************************************/ - -ULONG map_x11_to_hidd(long *penarray, ULONG x11pixel); -XImage *alloc_ximage(Display *display, int screen, ULONG width, UBYTE depth, UBYTE height); -VOID free_ximage(XImage *image); - -/****************************************************************************************/ - -#define USE_X11_DRAWFUNCS 1 -#define X11SOFTMOUSE 1 /* Use software mouse sprite */ -#define ADJUST_XWIN_SIZE 1 /* Resize the xwindow to the size of the actual visible screen */ - -/****************************************************************************************/ - -/* Private Attrs and methods for the X11Gfx Hidd */ - -#define CLID_Hidd_Gfx_X11 "hidd.gfx.x11" -#define IID_Hidd_Gfx_X11 "hidd.gfx.x11" - -#define PEN_BITS 4 -#define NUM_COLORS (1L << PEN_BITS) -#define PEN_MASK (NUM_COLORS - 1) - -#endif /* X11GFX_INTERN_H */ diff --git a/arch/all-hosted/hidd/x11/x11kbd.c b/arch/all-hosted/hidd/x11/x11kbd.c index 813a84337b..2cfa87078c 100644 --- a/arch/all-hosted/hidd/x11/x11kbd.c +++ b/arch/all-hosted/hidd/x11/x11kbd.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: X11 hidd handling keypresses. @@ -7,36 +7,21 @@ */ #define DEBUG 0 -#define __OOP_NOATTRBASES__ +#include "x11_debug.h" -#include +#define __OOP_NOATTRBASES__ -#include #include -#include -#include +#include +#include #define timeval sys_timeval -#include #include -#include - -#include #undef timeval -#include -#include - -#include - -#include - -//#define DEBUG 1 -#include - +#include "x11_types.h" #include LC_LIBDEFS_FILE - -#include "x11.h" +#include "x11_hostlib.h" /****************************************************************************************/ diff --git a/arch/all-hosted/hidd/x11/x11mouse.c b/arch/all-hosted/hidd/x11/x11mouse.c index fdcf769b46..7485878f82 100644 --- a/arch/all-hosted/hidd/x11/x11mouse.c +++ b/arch/all-hosted/hidd/x11/x11mouse.c @@ -1,31 +1,21 @@ /* - Copyright © 1995-2009, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ Desc: X11 hidd handling mouse events. Lang: English. */ +#include "x11_debug.h" + #define __OOP_NOATTRBASES__ #include -#include -#include - -#include - -#include #include -#include - -#define DEBUG 0 -#include - +#include "x11_types.h" #include LC_LIBDEFS_FILE -#include "x11.h" - /****************************************************************************************/ static OOP_AttrBase HiddMouseAB; diff --git a/arch/all-hosted/hidd/x11/xshm.c b/arch/all-hosted/hidd/x11/xshm.c index b234729ff5..bd035695a3 100644 --- a/arch/all-hosted/hidd/x11/xshm.c +++ b/arch/all-hosted/hidd/x11/xshm.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2001, The AROS Development Team. All rights reserved. + Copyright © 1995-2016, The AROS Development Team. All rights reserved. $Id$ */ @@ -11,15 +11,14 @@ conflicts between AROS includes and system includes */ singlethreded by the LOCK_X11/UNLOCK_X11 macros form the outside */ -#include -#include -#include -#include -#include "xshm.h" -#include +#include "x11_debug.h" +#include #include +#include "x11_types.h" +#include "xshm.h" + /****************************************************************************************/ /* stegerg: maybe more safe, even if Unix malloc is used and not AROS malloc */ @@ -28,7 +27,6 @@ conflicts between AROS includes and system includes */ /****************************************************************************************/ #if NO_MALLOC -#include #include #endif @@ -38,14 +36,10 @@ conflicts between AROS includes and system includes */ /****************************************************************************************/ -#include -#include #include #include "x11_hostlib.h" -#include - static void *xext_handle = NULL; static struct { -- 2.11.4.GIT