mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8210776: Upgrade X Window System 6.8.2 to the latest XWD 1.0.7
Reviewed-by: serb
This commit is contained in:
parent
b553485436
commit
bf7a30f5cf
10 changed files with 521 additions and 769 deletions
|
@ -1,21 +1,19 @@
|
|||
## X Windows System v6.8.2
|
||||
## xwd v1.0.7
|
||||
|
||||
### X Windows System License
|
||||
### xwd utility
|
||||
<pre>
|
||||
|
||||
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
|
||||
|
||||
Copyright (c) 1994 Hewlett-Packard Co.
|
||||
Copyright (c) 1996 X Consortium
|
||||
Copyright 1994 Hewlett-Packard Co.
|
||||
Copyright 1996, 1998 The Open Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
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
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
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,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
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
|
||||
other dealings in this Software without prior written authorization
|
||||
from the X Consortium.
|
||||
from The Open Group.
|
||||
|
||||
</pre>
|
|
@ -42,13 +42,14 @@
|
|||
#include <X11/extensions/XI.h>
|
||||
#include <jni.h>
|
||||
#include <sizecalc.h>
|
||||
#include "robot_common.h"
|
||||
#include "canvas.h"
|
||||
#include "wsutils.h"
|
||||
#include "list.h"
|
||||
#include "multiVis.h"
|
||||
#include "gtk_interface.h"
|
||||
|
||||
#include "java_awt_event_InputEvent.h"
|
||||
|
||||
#if defined(__linux__) || defined(MACOSX)
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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
|
||||
* questions.
|
||||
*/
|
||||
/* $XConsortium: list.c /main/4 1996/10/14 15:03:56 swick $ */
|
||||
/** ------------------------------------------------------------------------
|
||||
This file contains routines for manipulating generic lists.
|
||||
Lists are implemented with a "harness". In other words, each
|
||||
|
@ -36,16 +36,14 @@
|
|||
However, the following notice accompanied the original version of this
|
||||
file:
|
||||
|
||||
Copyright (c) 1994 Hewlett-Packard Co.
|
||||
Copyright (c) 1996 X Consortium
|
||||
Copyright 1994 Hewlett-Packard Co.
|
||||
Copyright 1996, 1998 The Open Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
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
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
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,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
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
|
||||
other dealings in this Software without prior written authorization
|
||||
from the X Consortium.
|
||||
from The Open Group.
|
||||
|
||||
----------------------------------------------------------------------- **/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "list.h"
|
||||
|
||||
|
||||
/** ------------------------------------------------------------------------
|
||||
Sets the pointers of the specified list to NULL.
|
||||
--------------------------------------------------------------------- **/
|
||||
#if NeedFunctionPrototypes
|
||||
void zero_list(list_ptr lp)
|
||||
#else
|
||||
void zero_list(lp)
|
||||
list_ptr lp;
|
||||
#endif
|
||||
{
|
||||
lp->next = 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.
|
||||
Returns 1 if successful, 0 if the malloc failed.
|
||||
-------------------------------------------------------------------- **/
|
||||
#if NeedFunctionPrototypes
|
||||
int32_t add_to_list(list_ptr lp, void *item)
|
||||
#else
|
||||
int32_t add_to_list(lp, item)
|
||||
list_ptr lp;
|
||||
void *item;
|
||||
#endif
|
||||
int add_to_list(list_ptr lp, void *item)
|
||||
{
|
||||
while (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.
|
||||
Returns a pointer to the new list.
|
||||
-------------------------------------------------------------------- **/
|
||||
list_ptr new_list ()
|
||||
list_ptr new_list (void)
|
||||
{
|
||||
list_ptr lp;
|
||||
|
||||
if (lp = (list_ptr) malloc( sizeof( list_item))) {
|
||||
if ((lp = (list_ptr) malloc( sizeof( list_item)))) {
|
||||
lp->next = 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.
|
||||
Returns a pointer to the new list head.
|
||||
-------------------------------------------------------------------- **/
|
||||
#if NeedFunctionPrototypes
|
||||
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 dup_list_head(list_ptr lp, int start_at_curr)
|
||||
{
|
||||
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;
|
||||
}
|
||||
new_list->next = start_at_curr ? lp->ptr.curr : lp->next;
|
||||
new_list->ptr.curr = lp->ptr.curr;
|
||||
new_listp->next = start_at_curr ? lp->ptr.curr : lp->next;
|
||||
new_listp->ptr.curr = lp->ptr.curr;
|
||||
|
||||
return new_list;
|
||||
return new_listp;
|
||||
}
|
||||
|
||||
|
||||
/** ------------------------------------------------------------------------
|
||||
Returns the number of items in the list.
|
||||
-------------------------------------------------------------------- **/
|
||||
#if NeedFunctionPrototypes
|
||||
uint32_t list_length(list_ptr lp)
|
||||
#else
|
||||
uint32_t list_length(lp)
|
||||
list_ptr lp;
|
||||
#endif
|
||||
unsigned int list_length(list_ptr lp)
|
||||
{
|
||||
uint32_t count = 0;
|
||||
unsigned int count = 0;
|
||||
|
||||
while (lp->next) {
|
||||
count++;
|
||||
|
@ -191,13 +168,7 @@ uint32_t list_length(lp)
|
|||
Returns a pointer to the item, so the caller can free it if it
|
||||
so desires. If a match is not found, returns NULL.
|
||||
-------------------------------------------------------------------- **/
|
||||
#if NeedFunctionPrototypes
|
||||
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;
|
||||
|
||||
|
@ -222,13 +193,7 @@ void *delete_from_list(lp, item)
|
|||
with new_list(). If free_items is true, each item pointed to
|
||||
from the node is freed, in addition to the node itself.
|
||||
-------------------------------------------------------------------- **/
|
||||
#if NeedFunctionPrototypes
|
||||
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
|
||||
void delete_list(list_ptr lp, int free_items)
|
||||
{
|
||||
list_ptr del_node;
|
||||
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))
|
||||
#else
|
||||
void delete_list_destroying(lp, destructor)
|
||||
list_ptr lp;
|
||||
void (*destructor)();
|
||||
#endif
|
||||
{
|
||||
list_ptr del_node;
|
||||
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.
|
||||
Returns NULL if the list is empty.
|
||||
-------------------------------------------------------------------- **/
|
||||
#if NeedFunctionPrototypes
|
||||
void * first_in_list(list_ptr lp)
|
||||
#else
|
||||
void * first_in_list(lp)
|
||||
list_ptr lp;
|
||||
#endif
|
||||
{
|
||||
if (! lp) {
|
||||
|
||||
|
@ -294,12 +248,7 @@ void * first_in_list(lp)
|
|||
first_in_list must have been called prior.
|
||||
Returns NULL if no next item.
|
||||
-------------------------------------------------------------------- **/
|
||||
#if NeedFunctionPrototypes
|
||||
void * next_in_list(list_ptr lp)
|
||||
#else
|
||||
void * next_in_list(lp)
|
||||
list_ptr lp;
|
||||
#endif
|
||||
{
|
||||
if (! lp) {
|
||||
|
||||
|
@ -312,12 +261,8 @@ void * next_in_list(lp)
|
|||
return lp->ptr.curr ? lp->ptr.curr->ptr.item : NULL;
|
||||
}
|
||||
|
||||
#if NeedFunctionPrototypes
|
||||
int32_t list_is_empty(list_ptr lp)
|
||||
#else
|
||||
int32_t list_is_empty(lp)
|
||||
list_ptr lp;
|
||||
#endif
|
||||
int list_is_empty(list_ptr lp)
|
||||
{
|
||||
return (lp == NULL || lp->next == NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
* 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
|
||||
* questions.
|
||||
*/
|
||||
/* $XConsortium: list.h /main/4 1996/10/14 15:04:04 swick $ */
|
||||
/** ------------------------------------------------------------------------
|
||||
This file contains routines for manipulating generic lists.
|
||||
Lists are implemented with a "harness". In other words, each
|
||||
|
@ -36,16 +36,14 @@
|
|||
However, the following notice accompanied the original version of this
|
||||
file:
|
||||
|
||||
Copyright (c) 1994 Hewlett-Packard Co.
|
||||
Copyright (c) 1996 X Consortium
|
||||
Copyright 1994 Hewlett-Packard Co.
|
||||
Copyright 1996, 1998 The Open Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
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
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
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,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
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
|
||||
other dealings in this Software without prior written authorization
|
||||
from the X Consortium.
|
||||
from The Open Group.
|
||||
|
||||
-------------------------------------------------------------------- **/
|
||||
|
||||
#include "gdefs.h"
|
||||
|
||||
#ifndef LIST_DEF
|
||||
#define LIST_DEF
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#define LESS -1
|
||||
#define EQUAL 0
|
||||
#define GREATER 1
|
||||
|
@ -85,65 +82,41 @@ typedef struct _list_item {
|
|||
} list, list_item, *list_ptr;
|
||||
|
||||
typedef void (*DESTRUCT_FUNC_PTR)(
|
||||
#if NeedFunctionPrototypes
|
||||
void *
|
||||
#endif
|
||||
);
|
||||
|
||||
void zero_list(
|
||||
#if NeedFunctionPrototypes
|
||||
list_ptr
|
||||
#endif
|
||||
);
|
||||
int32_t add_to_list (
|
||||
#if NeedFunctionPrototypes
|
||||
int add_to_list (
|
||||
list_ptr , void *
|
||||
#endif
|
||||
);
|
||||
list_ptr new_list (
|
||||
#if NeedFunctionPrototypes
|
||||
void
|
||||
#endif
|
||||
);
|
||||
list_ptr dup_list_head (
|
||||
#if NeedFunctionPrototypes
|
||||
list_ptr , int32_t
|
||||
#endif
|
||||
list_ptr , int
|
||||
);
|
||||
uint32_t list_length(
|
||||
#if NeedFunctionPrototypes
|
||||
unsigned int list_length(
|
||||
list_ptr
|
||||
#endif
|
||||
);
|
||||
void *delete_from_list (
|
||||
#if NeedFunctionPrototypes
|
||||
list_ptr , void *
|
||||
#endif
|
||||
);
|
||||
void delete_list(
|
||||
#if NeedFunctionPrototypes
|
||||
list_ptr , int32_t
|
||||
#endif
|
||||
list_ptr , int
|
||||
);
|
||||
void delete_list_destroying (
|
||||
#if NeedFunctionPrototypes
|
||||
list_ptr , DESTRUCT_FUNC_PTR
|
||||
#endif
|
||||
);
|
||||
void *first_in_list (
|
||||
#if NeedFunctionPrototypes
|
||||
list_ptr
|
||||
#endif
|
||||
);
|
||||
void *next_in_list (
|
||||
#if NeedFunctionPrototypes
|
||||
list_ptr
|
||||
#endif
|
||||
);
|
||||
int32_t list_is_empty (
|
||||
#if NeedFunctionPrototypes
|
||||
int list_is_empty (
|
||||
list_ptr
|
||||
#endif
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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.
|
||||
*
|
||||
* 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
|
||||
* questions.
|
||||
*/
|
||||
/* $XConsortium: multiVis.h /main/4 1996/10/14 15:04:12 swick $ */
|
||||
/** ------------------------------------------------------------------------
|
||||
This file contains routines for manipulating generic lists.
|
||||
Lists are implemented with a "harness". In other words, each
|
||||
|
@ -36,16 +36,14 @@
|
|||
However, the following notice accompanied the original version of this
|
||||
file:
|
||||
|
||||
Copyright (c) 1994 Hewlett-Packard Co.
|
||||
Copyright (c) 1996 X Consortium
|
||||
Copyright 1994 Hewlett-Packard Co.
|
||||
Copyright 1996, 1998 The Open Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
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
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
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,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
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
|
||||
other dealings in this Software without prior written authorization
|
||||
from the X Consortium.
|
||||
from The Open Group.
|
||||
|
||||
------------------------------------------------------------------------ **/
|
||||
|
||||
extern int32_t GetMultiVisualRegions(
|
||||
#if NeedFunctionPrototypes
|
||||
Display *, Window, int32_t, int32_t, uint32_t,
|
||||
uint32_t, int32_t *, int32_t *, XVisualInfo **, int32_t *,
|
||||
OverlayInfo **, int32_t *, XVisualInfo ***, list_ptr *,
|
||||
list_ptr *, int32_t *
|
||||
#endif
|
||||
extern int GetMultiVisualRegions(
|
||||
Display *, Window, int, int, unsigned int,
|
||||
unsigned int, int *, int *, XVisualInfo **, int *,
|
||||
OverlayInfo **, int *, XVisualInfo ***, list_ptr *,
|
||||
list_ptr *, int *
|
||||
);
|
||||
|
||||
extern XImage *ReadAreaToImage(
|
||||
#if NeedFunctionPrototypes
|
||||
Display *, Window, int32_t, int32_t, uint32_t,
|
||||
uint32_t, int32_t, XVisualInfo *, int32_t,
|
||||
OverlayInfo *, int32_t, XVisualInfo **, list_ptr,
|
||||
list_ptr, int32_t, int32_t
|
||||
#endif
|
||||
Display *, Window, int, int, unsigned int,
|
||||
unsigned int, int, XVisualInfo *, int,
|
||||
OverlayInfo *, int, XVisualInfo **, list_ptr,
|
||||
list_ptr, int, int
|
||||
);
|
||||
|
||||
extern void initFakeVisual(
|
||||
#if NeedFunctionPrototypes
|
||||
Visual *
|
||||
#endif
|
||||
);
|
||||
|
|
|
@ -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 ;
|
||||
}
|
|
@ -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 */
|
|
@ -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.
|
||||
*
|
||||
* 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
|
||||
* questions.
|
||||
*/
|
||||
/* $XConsortium: wsutils.h /main/3 1996/10/14 15:04:17 swick $ */
|
||||
/** ------------------------------------------------------------------------
|
||||
This file contains routines for manipulating generic lists.
|
||||
Lists are implemented with a "harness". In other words, each
|
||||
|
@ -36,16 +36,14 @@
|
|||
However, the following notice accompanied the original version of this
|
||||
file:
|
||||
|
||||
Copyright (c) 1994 Hewlett-Packard Co.
|
||||
Copyright (c) 1996 X Consortium
|
||||
Copyright 1994 Hewlett-Packard Co.
|
||||
Copyright 1996, 1998 The Open Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
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
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
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,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
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
|
||||
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
|
||||
|
@ -71,16 +70,18 @@ from the X Consortium.
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef unsigned long Pixel;
|
||||
|
||||
/* This is the actual structure returned by the X server describing the
|
||||
* SERVER_OVERLAY_VISUAL property.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
VisualID visualID; /* The VisualID of the overlay visual */
|
||||
long transparentType; /* Can be None, TransparentPixel or
|
||||
int transparentType; /* Can be None, TransparentPixel or
|
||||
* TransparentMask */
|
||||
long value; /* Pixel value */
|
||||
long layer; /* Overlay planes will always be in
|
||||
Pixel value; /* Pixel value */
|
||||
int layer; /* Overlay planes will always be in
|
||||
* layer 1 */
|
||||
} OverlayVisualPropertyRec;
|
||||
|
||||
|
@ -93,10 +94,10 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
XVisualInfo *pOverlayVisualInfo; /* Pointer to the XVisualInfo struct */
|
||||
long transparentType; /* Can be None, TransparentPixel or
|
||||
int transparentType; /* Can be None, TransparentPixel or
|
||||
* TransparentMask */
|
||||
long value; /* Pixel value */
|
||||
long layer; /* Overlay planes will always be in
|
||||
Pixel value; /* Pixel value */
|
||||
int layer; /* Overlay planes will always be in
|
||||
* layer 1 */
|
||||
} OverlayInfo;
|
||||
|
||||
|
@ -158,27 +159,25 @@ typedef struct
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
extern int32_t GetXVisualInfo(
|
||||
#if NeedFunctionPrototypes
|
||||
extern int GetXVisualInfo(
|
||||
Display *display, /* Which X server (aka "display"). */
|
||||
int32_t screen, /* Which screen of the "display". */
|
||||
int32_t *transparentOverlays, /* Non-zero if there's at least one
|
||||
int screen, /* Which screen of the "display". */
|
||||
int *transparentOverlays, /* Non-zero if there's at least one
|
||||
* overlay visual and if at least one
|
||||
* of those supports a transparent
|
||||
* pixel. */
|
||||
int32_t *numVisuals, /* Number of XVisualInfo struct's
|
||||
* pointed to by pVisuals. */
|
||||
int *numVisuals, /* Number of XVisualInfo struct's
|
||||
* pointed to to by pVisuals. */
|
||||
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
|
||||
* number is zero, the device does
|
||||
* not have overlay planes. */
|
||||
OverlayInfo **pOverlayVisuals, /* The device's overlay plane visual
|
||||
* information. */
|
||||
int32_t *numImageVisuals, /* Number of XVisualInfo's pointed
|
||||
int *numImageVisuals, /* Number of XVisualInfo's pointed
|
||||
* to by pImageVisuals. */
|
||||
XVisualInfo ***pImageVisuals /* The device's image visuals. */
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
|
@ -191,11 +190,9 @@ extern int32_t GetXVisualInfo(
|
|||
******************************************************************************/
|
||||
|
||||
extern void FreeXVisualInfo(
|
||||
#if NeedFunctionPrototypes
|
||||
XVisualInfo *pVisuals,
|
||||
OverlayInfo *pOverlayVisuals,
|
||||
XVisualInfo **pImageVisuals
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
|
@ -219,22 +216,20 @@ extern void FreeXVisualInfo(
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
extern int32_t FindImagePlanesVisual(
|
||||
#if NeedFunctionPrototypes
|
||||
extern int FindImagePlanesVisual(
|
||||
Display *display, /* Which X server (aka "display"). */
|
||||
int32_t screen, /* Which screen of the "display". */
|
||||
int32_t numImageVisuals, /* Number of XVisualInfo's pointed
|
||||
int screen, /* Which screen of the "display". */
|
||||
int numImageVisuals, /* Number of XVisualInfo's pointed
|
||||
* to by pImageVisuals. */
|
||||
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
|
||||
* is a mask of the possible values. */
|
||||
int32_t depthHint, /* Desired depth. */
|
||||
int32_t depthFlexibility, /* How much the actual value in
|
||||
int depthHint, /* Desired depth. */
|
||||
int depthFlexibility, /* How much the actual value in
|
||||
* "depthHint" is desired. */
|
||||
Visual **pImageVisualToUse, /* The screen's image visual to use. */
|
||||
int32_t *depthObtained /* Actual depth of the visual. */
|
||||
#endif
|
||||
int *depthObtained /* Actual depth of the visual. */
|
||||
);
|
||||
|
||||
|
||||
|
@ -267,25 +262,23 @@ extern int32_t FindImagePlanesVisual(
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
extern int32_t FindOverlayPlanesVisual(
|
||||
#if NeedFunctionPrototypes
|
||||
extern int FindOverlayPlanesVisual(
|
||||
Display *display, /* Which X server (aka "display"). */
|
||||
int32_t screen, /* Which screen of the "display". */
|
||||
int32_t numOverlayVisuals, /* Number of OverlayInfo's pointed
|
||||
int screen, /* Which screen of the "display". */
|
||||
int numOverlayVisuals, /* Number of OverlayInfo's pointed
|
||||
* to by pOverlayVisuals. */
|
||||
OverlayInfo *pOverlayVisuals, /* The device's overlay plane visual
|
||||
* information. */
|
||||
int32_t depthHint, /* Desired depth. */
|
||||
int32_t depthFlexibility, /* How much the actual value in
|
||||
int depthHint, /* Desired depth. */
|
||||
int depthFlexibility, /* How much the actual value in
|
||||
* "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. */
|
||||
Visual **pOverlayVisualToUse, /* The screen's overlay visual to
|
||||
* use. */
|
||||
int32_t *depthObtained, /* Actual depth of the visual. */
|
||||
int32_t *transparentColor /* The transparent color the program
|
||||
int *depthObtained, /* Actual depth of the visual. */
|
||||
int *transparentColor /* The transparent color the program
|
||||
* can use with the visual. */
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
|
@ -308,27 +301,25 @@ extern int32_t FindOverlayPlanesVisual(
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
extern int32_t CreateImagePlanesWindow(
|
||||
#if NeedFunctionPrototypes
|
||||
extern int CreateImagePlanesWindow(
|
||||
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
|
||||
* the created window. */
|
||||
int32_t windowX, /* Desired X coord. of the window. */
|
||||
int32_t windowY, /* Desired Y coord of the window. */
|
||||
int32_t windowWidth, /* Desired width of the window. */
|
||||
int32_t windowHeight, /* Desired height of the window. */
|
||||
int32_t windowDepth, /* Desired depth of the window. */
|
||||
int windowX, /* Desired X coord. of the window. */
|
||||
int windowY, /* Desired Y coord of the window. */
|
||||
int windowWidth, /* Desired width of the window. */
|
||||
int windowHeight, /* Desired height of the window. */
|
||||
int windowDepth, /* Desired depth of the window. */
|
||||
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 *windowName, /* Name to put on window's border. */
|
||||
char *iconName, /* Name to put on window's icon. */
|
||||
Window *imageWindow, /* Window ID of the created window. */
|
||||
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. */
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
|
@ -351,30 +342,28 @@ extern int32_t CreateImagePlanesWindow(
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
int32_t CreateOverlayPlanesWindow(
|
||||
#if NeedFunctionPrototypes
|
||||
int CreateOverlayPlanesWindow(
|
||||
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
|
||||
* the created window. */
|
||||
int32_t windowX, /* Desired X coord. of the window. */
|
||||
int32_t windowY, /* Desired Y coord of the window. */
|
||||
int32_t windowWidth, /* Desired width of the window. */
|
||||
int32_t windowHeight, /* Desired height of the window. */
|
||||
int32_t windowDepth, /* Desired depth of the window. */
|
||||
int windowX, /* Desired X coord. of the window. */
|
||||
int windowY, /* Desired Y coord of the window. */
|
||||
int windowWidth, /* Desired width of the window. */
|
||||
int windowHeight, /* Desired height of the window. */
|
||||
int windowDepth, /* Desired depth of the window. */
|
||||
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 *windowName, /* Name to put on window's border. */
|
||||
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. */
|
||||
int32_t *transparentColor, /* The transparent color to use as the
|
||||
int *transparentColor, /* The transparent color to use as the
|
||||
* window's background. */
|
||||
Window *overlayWindow, /* Window ID of the created window. */
|
||||
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
|
||||
* overlayColormap. */
|
||||
#endif
|
||||
);
|
||||
|
|
|
@ -47,7 +47,7 @@ public abstract class Common {
|
|||
static final int STATIC_BLOCKS = 30;
|
||||
static final Color BG_COLOR = Color.BLUE;
|
||||
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 int dl = 100;
|
||||
static final Class[] WINDOWS_TO_TEST = { Window.class, Frame.class, Dialog.class };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue