8210776: Upgrade X Window System 6.8.2 to the latest XWD 1.0.7

Reviewed-by: serb
This commit is contained in:
Phil Race 2018-11-08 10:34:49 -08:00
parent b553485436
commit bf7a30f5cf
10 changed files with 521 additions and 769 deletions

View file

@ -1,21 +1,19 @@
## X Windows System v6.8.2 ## xwd v1.0.7
### X Windows System License ### xwd utility
<pre> <pre>
This is the copyright for the files in src/java.desktop/unix/native/libawt_xawt: This is the copyright for the files in src/java.desktop/unix/native/libawt_xawt:
list.h, multiVis.h, wsutils.h, list.c, multiVis.c list.h, multiVis.h, wsutils.h, list.c, multiVis.c
Copyright (c) 1994 Hewlett-Packard Co. Copyright 1994 Hewlett-Packard Co.
Copyright (c) 1996 X Consortium Copyright 1996, 1998 The Open Group
Permission is hereby granted, free of charge, to any person obtaining Permission to use, copy, modify, distribute, and sell this software and its
a copy of this software and associated documentation files (the documentation for any purpose is hereby granted without fee, provided that
"Software"), to deal in the Software without restriction, including the above copyright notice appear in all copies and that both that
without limitation the rights to use, copy, modify, merge, publish, copyright notice and this permission notice appear in supporting
distribute, sublicense, and sell copies of the Software, and to documentation.
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software. in all copies or substantial portions of the Software.
@ -23,14 +21,14 @@ in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization other dealings in this Software without prior written authorization
from the X Consortium. from The Open Group.
</pre> </pre>

View file

@ -42,13 +42,14 @@
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <jni.h> #include <jni.h>
#include <sizecalc.h> #include <sizecalc.h>
#include "robot_common.h"
#include "canvas.h" #include "canvas.h"
#include "wsutils.h" #include "wsutils.h"
#include "list.h" #include "list.h"
#include "multiVis.h" #include "multiVis.h"
#include "gtk_interface.h" #include "gtk_interface.h"
#include "java_awt_event_InputEvent.h"
#if defined(__linux__) || defined(MACOSX) #if defined(__linux__) || defined(MACOSX)
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif

View file

@ -1,4 +1,5 @@
/* /*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -21,7 +22,6 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
/* $XConsortium: list.c /main/4 1996/10/14 15:03:56 swick $ */
/** ------------------------------------------------------------------------ /** ------------------------------------------------------------------------
This file contains routines for manipulating generic lists. This file contains routines for manipulating generic lists.
Lists are implemented with a "harness". In other words, each Lists are implemented with a "harness". In other words, each
@ -36,16 +36,14 @@
However, the following notice accompanied the original version of this However, the following notice accompanied the original version of this
file: file:
Copyright (c) 1994 Hewlett-Packard Co. Copyright 1994 Hewlett-Packard Co.
Copyright (c) 1996 X Consortium Copyright 1996, 1998 The Open Group
Permission is hereby granted, free of charge, to any person obtaining Permission to use, copy, modify, distribute, and sell this software and its
a copy of this software and associated documentation files (the documentation for any purpose is hereby granted without fee, provided that
"Software"), to deal in the Software without restriction, including the above copyright notice appear in all copies and that both that
without limitation the rights to use, copy, modify, merge, publish, copyright notice and this permission notice appear in supporting
distribute, sublicense, and sell copies of the Software, and to documentation.
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software. in all copies or substantial portions of the Software.
@ -53,32 +51,28 @@ in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization other dealings in this Software without prior written authorization
from the X Consortium. from The Open Group.
----------------------------------------------------------------------- **/ ----------------------------------------------------------------------- **/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "list.h" #include "list.h"
/** ------------------------------------------------------------------------ /** ------------------------------------------------------------------------
Sets the pointers of the specified list to NULL. Sets the pointers of the specified list to NULL.
--------------------------------------------------------------------- **/ --------------------------------------------------------------------- **/
#if NeedFunctionPrototypes
void zero_list(list_ptr lp) void zero_list(list_ptr lp)
#else
void zero_list(lp)
list_ptr lp;
#endif
{ {
lp->next = NULL; lp->next = NULL;
lp->ptr.item = NULL; lp->ptr.item = NULL;
@ -92,13 +86,7 @@ void zero_list(lp)
and the next pointer in the new node is set to NULL. and the next pointer in the new node is set to NULL.
Returns 1 if successful, 0 if the malloc failed. Returns 1 if successful, 0 if the malloc failed.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
#if NeedFunctionPrototypes int add_to_list(list_ptr lp, void *item)
int32_t add_to_list(list_ptr lp, void *item)
#else
int32_t add_to_list(lp, item)
list_ptr lp;
void *item;
#endif
{ {
while (lp->next) { while (lp->next) {
lp = lp->next; lp = lp->next;
@ -118,11 +106,11 @@ int32_t add_to_list(lp, item)
Creates a new list and sets its pointers to NULL. Creates a new list and sets its pointers to NULL.
Returns a pointer to the new list. Returns a pointer to the new list.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
list_ptr new_list () list_ptr new_list (void)
{ {
list_ptr lp; list_ptr lp;
if (lp = (list_ptr) malloc( sizeof( list_item))) { if ((lp = (list_ptr) malloc( sizeof( list_item)))) {
lp->next = NULL; lp->next = NULL;
lp->ptr.item = NULL; lp->ptr.item = NULL;
} }
@ -140,38 +128,27 @@ list_ptr new_list ()
curr pointer in the new list is the same as in the old list. curr pointer in the new list is the same as in the old list.
Returns a pointer to the new list head. Returns a pointer to the new list head.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
#if NeedFunctionPrototypes list_ptr dup_list_head(list_ptr lp, int start_at_curr)
list_ptr dup_list_head(list_ptr lp, int32_t start_at_curr)
#else
list_ptr dup_list_head(lp, start_at_curr)
list_ptr lp;
int32_t start_at_curr;
#endif
{ {
list_ptr new_list; list_ptr new_listp;
if ((new_list = (list_ptr) malloc( sizeof( list_item))) == NULL) { if ((new_listp = (list_ptr) malloc( sizeof( list_item))) == NULL) {
return (list_ptr)NULL; return (list_ptr)NULL;
} }
new_list->next = start_at_curr ? lp->ptr.curr : lp->next; new_listp->next = start_at_curr ? lp->ptr.curr : lp->next;
new_list->ptr.curr = lp->ptr.curr; new_listp->ptr.curr = lp->ptr.curr;
return new_list; return new_listp;
} }
/** ------------------------------------------------------------------------ /** ------------------------------------------------------------------------
Returns the number of items in the list. Returns the number of items in the list.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
#if NeedFunctionPrototypes unsigned int list_length(list_ptr lp)
uint32_t list_length(list_ptr lp)
#else
uint32_t list_length(lp)
list_ptr lp;
#endif
{ {
uint32_t count = 0; unsigned int count = 0;
while (lp->next) { while (lp->next) {
count++; count++;
@ -191,13 +168,7 @@ uint32_t list_length(lp)
Returns a pointer to the item, so the caller can free it if it Returns a pointer to the item, so the caller can free it if it
so desires. If a match is not found, returns NULL. so desires. If a match is not found, returns NULL.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
#if NeedFunctionPrototypes
void *delete_from_list(list_ptr lp, void *item) void *delete_from_list(list_ptr lp, void *item)
#else
void *delete_from_list(lp, item)
list_ptr lp;
void *item;
#endif
{ {
list_ptr new_next; list_ptr new_next;
@ -222,13 +193,7 @@ void *delete_from_list(lp, item)
with new_list(). If free_items is true, each item pointed to with new_list(). If free_items is true, each item pointed to
from the node is freed, in addition to the node itself. from the node is freed, in addition to the node itself.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
#if NeedFunctionPrototypes void delete_list(list_ptr lp, int free_items)
void delete_list(list_ptr lp, int32_t free_items)
#else
void delete_list(lp, free_items)
list_ptr lp;
int32_t free_items;
#endif
{ {
list_ptr del_node; list_ptr del_node;
void *item; void *item;
@ -244,13 +209,7 @@ void delete_list(lp, free_items)
} }
} }
#if NeedFunctionPrototypes
void delete_list_destroying(list_ptr lp, void destructor(void *item)) void delete_list_destroying(list_ptr lp, void destructor(void *item))
#else
void delete_list_destroying(lp, destructor)
list_ptr lp;
void (*destructor)();
#endif
{ {
list_ptr del_node; list_ptr del_node;
void *item; void *item;
@ -272,12 +231,7 @@ void delete_list_destroying(lp, destructor)
Sets the list head node's curr ptr to the first node in the list. Sets the list head node's curr ptr to the first node in the list.
Returns NULL if the list is empty. Returns NULL if the list is empty.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
#if NeedFunctionPrototypes
void * first_in_list(list_ptr lp) void * first_in_list(list_ptr lp)
#else
void * first_in_list(lp)
list_ptr lp;
#endif
{ {
if (! lp) { if (! lp) {
@ -294,12 +248,7 @@ void * first_in_list(lp)
first_in_list must have been called prior. first_in_list must have been called prior.
Returns NULL if no next item. Returns NULL if no next item.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
#if NeedFunctionPrototypes
void * next_in_list(list_ptr lp) void * next_in_list(list_ptr lp)
#else
void * next_in_list(lp)
list_ptr lp;
#endif
{ {
if (! lp) { if (! lp) {
@ -312,12 +261,8 @@ void * next_in_list(lp)
return lp->ptr.curr ? lp->ptr.curr->ptr.item : NULL; return lp->ptr.curr ? lp->ptr.curr->ptr.item : NULL;
} }
#if NeedFunctionPrototypes int list_is_empty(list_ptr lp)
int32_t list_is_empty(list_ptr lp)
#else
int32_t list_is_empty(lp)
list_ptr lp;
#endif
{ {
return (lp == NULL || lp->next == NULL); return (lp == NULL || lp->next == NULL);
} }

View file

@ -1,4 +1,5 @@
/* /*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -21,7 +22,6 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
/* $XConsortium: list.h /main/4 1996/10/14 15:04:04 swick $ */
/** ------------------------------------------------------------------------ /** ------------------------------------------------------------------------
This file contains routines for manipulating generic lists. This file contains routines for manipulating generic lists.
Lists are implemented with a "harness". In other words, each Lists are implemented with a "harness". In other words, each
@ -36,16 +36,14 @@
However, the following notice accompanied the original version of this However, the following notice accompanied the original version of this
file: file:
Copyright (c) 1994 Hewlett-Packard Co. Copyright 1994 Hewlett-Packard Co.
Copyright (c) 1996 X Consortium Copyright 1996, 1998 The Open Group
Permission is hereby granted, free of charge, to any person obtaining Permission to use, copy, modify, distribute, and sell this software and its
a copy of this software and associated documentation files (the documentation for any purpose is hereby granted without fee, provided that
"Software"), to deal in the Software without restriction, including the above copyright notice appear in all copies and that both that
without limitation the rights to use, copy, modify, merge, publish, copyright notice and this permission notice appear in supporting
distribute, sublicense, and sell copies of the Software, and to documentation.
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software. in all copies or substantial portions of the Software.
@ -53,23 +51,22 @@ in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization other dealings in this Software without prior written authorization
from the X Consortium. from The Open Group.
-------------------------------------------------------------------- **/ -------------------------------------------------------------------- **/
#include "gdefs.h"
#ifndef LIST_DEF #ifndef LIST_DEF
#define LIST_DEF #define LIST_DEF
#include <X11/Xfuncproto.h>
#define LESS -1 #define LESS -1
#define EQUAL 0 #define EQUAL 0
#define GREATER 1 #define GREATER 1
@ -85,65 +82,41 @@ typedef struct _list_item {
} list, list_item, *list_ptr; } list, list_item, *list_ptr;
typedef void (*DESTRUCT_FUNC_PTR)( typedef void (*DESTRUCT_FUNC_PTR)(
#if NeedFunctionPrototypes
void * void *
#endif
); );
void zero_list( void zero_list(
#if NeedFunctionPrototypes
list_ptr list_ptr
#endif
); );
int32_t add_to_list ( int add_to_list (
#if NeedFunctionPrototypes
list_ptr , void * list_ptr , void *
#endif
); );
list_ptr new_list ( list_ptr new_list (
#if NeedFunctionPrototypes
void void
#endif
); );
list_ptr dup_list_head ( list_ptr dup_list_head (
#if NeedFunctionPrototypes list_ptr , int
list_ptr , int32_t
#endif
); );
uint32_t list_length( unsigned int list_length(
#if NeedFunctionPrototypes
list_ptr list_ptr
#endif
); );
void *delete_from_list ( void *delete_from_list (
#if NeedFunctionPrototypes
list_ptr , void * list_ptr , void *
#endif
); );
void delete_list( void delete_list(
#if NeedFunctionPrototypes list_ptr , int
list_ptr , int32_t
#endif
); );
void delete_list_destroying ( void delete_list_destroying (
#if NeedFunctionPrototypes
list_ptr , DESTRUCT_FUNC_PTR list_ptr , DESTRUCT_FUNC_PTR
#endif
); );
void *first_in_list ( void *first_in_list (
#if NeedFunctionPrototypes
list_ptr list_ptr
#endif
); );
void *next_in_list ( void *next_in_list (
#if NeedFunctionPrototypes
list_ptr list_ptr
#endif
); );
int32_t list_is_empty ( int list_is_empty (
#if NeedFunctionPrototypes
list_ptr list_ptr
#endif
); );
#endif #endif

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
/* /*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -21,7 +22,6 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
/* $XConsortium: multiVis.h /main/4 1996/10/14 15:04:12 swick $ */
/** ------------------------------------------------------------------------ /** ------------------------------------------------------------------------
This file contains routines for manipulating generic lists. This file contains routines for manipulating generic lists.
Lists are implemented with a "harness". In other words, each Lists are implemented with a "harness". In other words, each
@ -36,16 +36,14 @@
However, the following notice accompanied the original version of this However, the following notice accompanied the original version of this
file: file:
Copyright (c) 1994 Hewlett-Packard Co. Copyright 1994 Hewlett-Packard Co.
Copyright (c) 1996 X Consortium Copyright 1996, 1998 The Open Group
Permission is hereby granted, free of charge, to any person obtaining Permission to use, copy, modify, distribute, and sell this software and its
a copy of this software and associated documentation files (the documentation for any purpose is hereby granted without fee, provided that
"Software"), to deal in the Software without restriction, including the above copyright notice appear in all copies and that both that
without limitation the rights to use, copy, modify, merge, publish, copyright notice and this permission notice appear in supporting
distribute, sublicense, and sell copies of the Software, and to documentation.
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software. in all copies or substantial portions of the Software.
@ -53,38 +51,32 @@ in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization other dealings in this Software without prior written authorization
from the X Consortium. from The Open Group.
------------------------------------------------------------------------ **/ ------------------------------------------------------------------------ **/
extern int32_t GetMultiVisualRegions( extern int GetMultiVisualRegions(
#if NeedFunctionPrototypes Display *, Window, int, int, unsigned int,
Display *, Window, int32_t, int32_t, uint32_t, unsigned int, int *, int *, XVisualInfo **, int *,
uint32_t, int32_t *, int32_t *, XVisualInfo **, int32_t *, OverlayInfo **, int *, XVisualInfo ***, list_ptr *,
OverlayInfo **, int32_t *, XVisualInfo ***, list_ptr *, list_ptr *, int *
list_ptr *, int32_t *
#endif
); );
extern XImage *ReadAreaToImage( extern XImage *ReadAreaToImage(
#if NeedFunctionPrototypes Display *, Window, int, int, unsigned int,
Display *, Window, int32_t, int32_t, uint32_t, unsigned int, int, XVisualInfo *, int,
uint32_t, int32_t, XVisualInfo *, int32_t, OverlayInfo *, int, XVisualInfo **, list_ptr,
OverlayInfo *, int32_t, XVisualInfo **, list_ptr, list_ptr, int, int
list_ptr, int32_t, int32_t
#endif
); );
extern void initFakeVisual( extern void initFakeVisual(
#if NeedFunctionPrototypes
Visual * Visual *
#endif
); );

View file

@ -1,101 +0,0 @@
/*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifdef HEADLESS
#error This file should not be included in headless library
#endif
#ifdef MACOSX
#include <stdlib.h>
#endif
#include "robot_common.h"
/*
* QueryColorMap is taken from multiVis.c, part of the xwd distribution from
* X.org. It was moved here so it can be shared with awt_DataTransferer.c
*/
int32_t
QueryColorMap(Display *disp,
Colormap src_cmap,
Visual *src_vis,
XColor **src_colors,
int32_t *rShift, int32_t *gShift, int32_t *bShift)
{
int32_t ncolors, i;
unsigned long redMask, greenMask, blueMask;
int32_t redShift, greenShift, blueShift;
XColor *colors ;
ncolors = src_vis->map_entries ;
*src_colors = colors = (XColor *)calloc(ncolors,sizeof(XColor) ) ;
if(src_vis->class != TrueColor && src_vis->class != DirectColor)
{
for(i=0 ; i < ncolors ; i++)
{
colors[i].pixel = i ;
colors[i].pad = 0;
colors[i].flags = DoRed|DoGreen|DoBlue;
}
}
else /** src is decomposed rgb ***/
{
/* Get the X colormap */
redMask = src_vis->red_mask;
greenMask = src_vis->green_mask;
blueMask = src_vis->blue_mask;
redShift = 0; while (!(redMask&0x1)) {
redShift++;
redMask = redMask>>1;
}
greenShift = 0; while (!(greenMask&0x1)) {
greenShift++;
greenMask = greenMask>>1;
}
blueShift = 0; while (!(blueMask&0x1)) {
blueShift++;
blueMask = blueMask>>1;
}
*rShift = redShift ;
*gShift = greenShift ;
*bShift = blueShift ;
for (i=0; i<ncolors; i++) {
if( (uint32_t)i <= redMask) colors[i].pixel = (i<<redShift) ;
if( (uint32_t)i <= greenMask) colors[i].pixel |= (i<<greenShift) ;
if( (uint32_t)i <= blueMask) colors[i].pixel |= (i<<blueShift) ;
/***** example :for gecko's 3-3-2 map, blue index should be <= 3
.
colors[i].pixel = (i<<redShift)|(i<<greenShift)|(i<<blueShift);
*****/
colors[i].pad = 0;
colors[i].flags = DoRed|DoGreen|DoBlue;
}
}
XQueryColors(disp, src_cmap, colors, ncolors);
return ncolors ;
}

View file

@ -1,39 +0,0 @@
/*
* Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _ROBOT_COMMON_H
#define _ROBOT_COMMON_H
#include "java_awt_event_InputEvent.h"
#include <X11/Xlib.h>
#include "gdefs.h"
int QueryColorMap(Display *disp,
Colormap src_cmap,
Visual *src_vis,
XColor **src_colors,
int *rShift, int *gShift, int *bShift);
#endif /* _ROBOT_COMMON_H */

View file

@ -1,4 +1,5 @@
/* /*
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -21,7 +22,6 @@
* or visit www.oracle.com if you need additional information or have any * or visit www.oracle.com if you need additional information or have any
* questions. * questions.
*/ */
/* $XConsortium: wsutils.h /main/3 1996/10/14 15:04:17 swick $ */
/** ------------------------------------------------------------------------ /** ------------------------------------------------------------------------
This file contains routines for manipulating generic lists. This file contains routines for manipulating generic lists.
Lists are implemented with a "harness". In other words, each Lists are implemented with a "harness". In other words, each
@ -36,16 +36,14 @@
However, the following notice accompanied the original version of this However, the following notice accompanied the original version of this
file: file:
Copyright (c) 1994 Hewlett-Packard Co. Copyright 1994 Hewlett-Packard Co.
Copyright (c) 1996 X Consortium Copyright 1996, 1998 The Open Group
Permission is hereby granted, free of charge, to any person obtaining Permission to use, copy, modify, distribute, and sell this software and its
a copy of this software and associated documentation files (the documentation for any purpose is hereby granted without fee, provided that
"Software"), to deal in the Software without restriction, including the above copyright notice appear in all copies and that both that
without limitation the rights to use, copy, modify, merge, publish, copyright notice and this permission notice appear in supporting
distribute, sublicense, and sell copies of the Software, and to documentation.
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software. in all copies or substantial portions of the Software.
@ -53,17 +51,18 @@ in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization other dealings in this Software without prior written authorization
from the X Consortium. from The Open Group.
------------------------------------------------------------------------ **/ ------------------------------------------------------------------------ **/
/****************************************************************************** /******************************************************************************
* *
* This file contains various typedef's, macros and procedure declarations for * This file contains various typedef's, macros and procedure declarations for
@ -71,16 +70,18 @@ from the X Consortium.
* *
******************************************************************************/ ******************************************************************************/
typedef unsigned long Pixel;
/* This is the actual structure returned by the X server describing the /* This is the actual structure returned by the X server describing the
* SERVER_OVERLAY_VISUAL property. * SERVER_OVERLAY_VISUAL property.
*/ */
typedef struct typedef struct
{ {
VisualID visualID; /* The VisualID of the overlay visual */ VisualID visualID; /* The VisualID of the overlay visual */
long transparentType; /* Can be None, TransparentPixel or int transparentType; /* Can be None, TransparentPixel or
* TransparentMask */ * TransparentMask */
long value; /* Pixel value */ Pixel value; /* Pixel value */
long layer; /* Overlay planes will always be in int layer; /* Overlay planes will always be in
* layer 1 */ * layer 1 */
} OverlayVisualPropertyRec; } OverlayVisualPropertyRec;
@ -93,10 +94,10 @@ typedef struct
typedef struct typedef struct
{ {
XVisualInfo *pOverlayVisualInfo; /* Pointer to the XVisualInfo struct */ XVisualInfo *pOverlayVisualInfo; /* Pointer to the XVisualInfo struct */
long transparentType; /* Can be None, TransparentPixel or int transparentType; /* Can be None, TransparentPixel or
* TransparentMask */ * TransparentMask */
long value; /* Pixel value */ Pixel value; /* Pixel value */
long layer; /* Overlay planes will always be in int layer; /* Overlay planes will always be in
* layer 1 */ * layer 1 */
} OverlayInfo; } OverlayInfo;
@ -158,27 +159,25 @@ typedef struct
* *
******************************************************************************/ ******************************************************************************/
extern int32_t GetXVisualInfo( extern int GetXVisualInfo(
#if NeedFunctionPrototypes
Display *display, /* Which X server (aka "display"). */ Display *display, /* Which X server (aka "display"). */
int32_t screen, /* Which screen of the "display". */ int screen, /* Which screen of the "display". */
int32_t *transparentOverlays, /* Non-zero if there's at least one int *transparentOverlays, /* Non-zero if there's at least one
* overlay visual and if at least one * overlay visual and if at least one
* of those supports a transparent * of those supports a transparent
* pixel. */ * pixel. */
int32_t *numVisuals, /* Number of XVisualInfo struct's int *numVisuals, /* Number of XVisualInfo struct's
* pointed to by pVisuals. */ * pointed to to by pVisuals. */
XVisualInfo **pVisuals, /* All of the device's visuals. */ XVisualInfo **pVisuals, /* All of the device's visuals. */
int32_t *numOverlayVisuals, /* Number of OverlayInfo's pointed int *numOverlayVisuals, /* Number of OverlayInfo's pointed
* to by pOverlayVisuals. If this * to by pOverlayVisuals. If this
* number is zero, the device does * number is zero, the device does
* not have overlay planes. */ * not have overlay planes. */
OverlayInfo **pOverlayVisuals, /* The device's overlay plane visual OverlayInfo **pOverlayVisuals, /* The device's overlay plane visual
* information. */ * information. */
int32_t *numImageVisuals, /* Number of XVisualInfo's pointed int *numImageVisuals, /* Number of XVisualInfo's pointed
* to by pImageVisuals. */ * to by pImageVisuals. */
XVisualInfo ***pImageVisuals /* The device's image visuals. */ XVisualInfo ***pImageVisuals /* The device's image visuals. */
#endif
); );
@ -191,11 +190,9 @@ extern int32_t GetXVisualInfo(
******************************************************************************/ ******************************************************************************/
extern void FreeXVisualInfo( extern void FreeXVisualInfo(
#if NeedFunctionPrototypes
XVisualInfo *pVisuals, XVisualInfo *pVisuals,
OverlayInfo *pOverlayVisuals, OverlayInfo *pOverlayVisuals,
XVisualInfo **pImageVisuals XVisualInfo **pImageVisuals
#endif
); );
@ -219,22 +216,20 @@ extern void FreeXVisualInfo(
* *
******************************************************************************/ ******************************************************************************/
extern int32_t FindImagePlanesVisual( extern int FindImagePlanesVisual(
#if NeedFunctionPrototypes
Display *display, /* Which X server (aka "display"). */ Display *display, /* Which X server (aka "display"). */
int32_t screen, /* Which screen of the "display". */ int screen, /* Which screen of the "display". */
int32_t numImageVisuals, /* Number of XVisualInfo's pointed int numImageVisuals, /* Number of XVisualInfo's pointed
* to by pImageVisuals. */ * to by pImageVisuals. */
XVisualInfo **pImageVisuals, /* The device's image visuals. */ XVisualInfo **pImageVisuals, /* The device's image visuals. */
int32_t sbCmapHint, /* What Starbase cmap modes will be int sbCmapHint, /* What Starbase cmap modes will be
* used with the visual. NOTE: This * used with the visual. NOTE: This
* is a mask of the possible values. */ * is a mask of the possible values. */
int32_t depthHint, /* Desired depth. */ int depthHint, /* Desired depth. */
int32_t depthFlexibility, /* How much the actual value in int depthFlexibility, /* How much the actual value in
* "depthHint" is desired. */ * "depthHint" is desired. */
Visual **pImageVisualToUse, /* The screen's image visual to use. */ Visual **pImageVisualToUse, /* The screen's image visual to use. */
int32_t *depthObtained /* Actual depth of the visual. */ int *depthObtained /* Actual depth of the visual. */
#endif
); );
@ -267,25 +262,23 @@ extern int32_t FindImagePlanesVisual(
* *
******************************************************************************/ ******************************************************************************/
extern int32_t FindOverlayPlanesVisual( extern int FindOverlayPlanesVisual(
#if NeedFunctionPrototypes
Display *display, /* Which X server (aka "display"). */ Display *display, /* Which X server (aka "display"). */
int32_t screen, /* Which screen of the "display". */ int screen, /* Which screen of the "display". */
int32_t numOverlayVisuals, /* Number of OverlayInfo's pointed int numOverlayVisuals, /* Number of OverlayInfo's pointed
* to by pOverlayVisuals. */ * to by pOverlayVisuals. */
OverlayInfo *pOverlayVisuals, /* The device's overlay plane visual OverlayInfo *pOverlayVisuals, /* The device's overlay plane visual
* information. */ * information. */
int32_t depthHint, /* Desired depth. */ int depthHint, /* Desired depth. */
int32_t depthFlexibility, /* How much the actual value in int depthFlexibility, /* How much the actual value in
* "depthHint" is desired. */ * "depthHint" is desired. */
int32_t transparentBackground, /* Non-zero if the visual must have int transparentBackground, /* Non-zero if the visual must have
* a transparent color. */ * a transparent color. */
Visual **pOverlayVisualToUse, /* The screen's overlay visual to Visual **pOverlayVisualToUse, /* The screen's overlay visual to
* use. */ * use. */
int32_t *depthObtained, /* Actual depth of the visual. */ int *depthObtained, /* Actual depth of the visual. */
int32_t *transparentColor /* The transparent color the program int *transparentColor /* The transparent color the program
* can use with the visual. */ * can use with the visual. */
#endif
); );
@ -308,27 +301,25 @@ extern int32_t FindOverlayPlanesVisual(
* *
******************************************************************************/ ******************************************************************************/
extern int32_t CreateImagePlanesWindow( extern int CreateImagePlanesWindow(
#if NeedFunctionPrototypes
Display *display, /* Which X server (aka "display"). */ Display *display, /* Which X server (aka "display"). */
int32_t screen, /* Which screen of the "display". */ int screen, /* Which screen of the "display". */
Window parentWindow, /* Window ID of the parent window for Window parentWindow, /* Window ID of the parent window for
* the created window. */ * the created window. */
int32_t windowX, /* Desired X coord. of the window. */ int windowX, /* Desired X coord. of the window. */
int32_t windowY, /* Desired Y coord of the window. */ int windowY, /* Desired Y coord of the window. */
int32_t windowWidth, /* Desired width of the window. */ int windowWidth, /* Desired width of the window. */
int32_t windowHeight, /* Desired height of the window. */ int windowHeight, /* Desired height of the window. */
int32_t windowDepth, /* Desired depth of the window. */ int windowDepth, /* Desired depth of the window. */
Visual *pImageVisualToUse, /* The window's image planes visual. */ Visual *pImageVisualToUse, /* The window's image planes visual. */
int32_t argc, /* Program's argc parameter. */ int argc, /* Program's argc parameter. */
char *argv[], /* Program's argv parameter. */ char *argv[], /* Program's argv parameter. */
char *windowName, /* Name to put on window's border. */ char *windowName, /* Name to put on window's border. */
char *iconName, /* Name to put on window's icon. */ char *iconName, /* Name to put on window's icon. */
Window *imageWindow, /* Window ID of the created window. */ Window *imageWindow, /* Window ID of the created window. */
Colormap *imageColormap, /* The window's colormap. */ Colormap *imageColormap, /* The window's colormap. */
int32_t *mustFreeImageColormap /* Non-zero if the program must call int *mustFreeImageColormap /* Non-zero if the program must call
* XFreeColormap() for imageColormap. */ * XFreeColormap() for imageColormap. */
#endif
); );
@ -351,30 +342,28 @@ extern int32_t CreateImagePlanesWindow(
* *
******************************************************************************/ ******************************************************************************/
int32_t CreateOverlayPlanesWindow( int CreateOverlayPlanesWindow(
#if NeedFunctionPrototypes
Display *display, /* Which X server (aka "display"). */ Display *display, /* Which X server (aka "display"). */
int32_t screen, /* Which screen of the "display". */ int screen, /* Which screen of the "display". */
Window parentWindow, /* Window ID of the parent window for Window parentWindow, /* Window ID of the parent window for
* the created window. */ * the created window. */
int32_t windowX, /* Desired X coord. of the window. */ int windowX, /* Desired X coord. of the window. */
int32_t windowY, /* Desired Y coord of the window. */ int windowY, /* Desired Y coord of the window. */
int32_t windowWidth, /* Desired width of the window. */ int windowWidth, /* Desired width of the window. */
int32_t windowHeight, /* Desired height of the window. */ int windowHeight, /* Desired height of the window. */
int32_t windowDepth, /* Desired depth of the window. */ int windowDepth, /* Desired depth of the window. */
Visual *pOverlayVisualToUse, /* The window's overlay planes visual.*/ Visual *pOverlayVisualToUse, /* The window's overlay planes visual.*/
int32_t argc, /* Program's argc parameter. */ int argc, /* Program's argc parameter. */
char *argv[], /* Program's argv parameter. */ char *argv[], /* Program's argv parameter. */
char *windowName, /* Name to put on window's border. */ char *windowName, /* Name to put on window's border. */
char *iconName, /* Name to put on window's icon. */ char *iconName, /* Name to put on window's icon. */
int32_t transparentBackground, /* Non-zero if the window's background int transparentBackground, /* Non-zero if the window's background
* should be a transparent color. */ * should be a transparent color. */
int32_t *transparentColor, /* The transparent color to use as the int *transparentColor, /* The transparent color to use as the
* window's background. */ * window's background. */
Window *overlayWindow, /* Window ID of the created window. */ Window *overlayWindow, /* Window ID of the created window. */
Colormap *overlayColormap, /* The window's colormap. */ Colormap *overlayColormap, /* The window's colormap. */
int32_t *mustFreeOverlayColormap/* Non-zero if the program must call int *mustFreeOverlayColormap/* Non-zero if the program must call
* XFreeColormap() for * XFreeColormap() for
* overlayColormap. */ * overlayColormap. */
#endif
); );

View file

@ -47,7 +47,7 @@ public abstract class Common {
static final int STATIC_BLOCKS = 30; static final int STATIC_BLOCKS = 30;
static final Color BG_COLOR = Color.BLUE; static final Color BG_COLOR = Color.BLUE;
static final Color FG_COLOR = Color.RED; static final Color FG_COLOR = Color.RED;
static final int delay = 1000; static final int delay = 55000;
static final SecureRandom random = new SecureRandom(); static final SecureRandom random = new SecureRandom();
static final int dl = 100; static final int dl = 100;
static final Class[] WINDOWS_TO_TEST = { Window.class, Frame.class, Dialog.class }; static final Class[] WINDOWS_TO_TEST = { Window.class, Frame.class, Dialog.class };