author | alitvinov |
Wed, 04 Dec 2013 12:29:18 +0400 | |
changeset 21939 | 5169fd314636 |
parent 18754 | 3db51db1e3d5 |
child 24165 | fb4f67872b27 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
17679
a81555868357
8005607: Recursion in J2DXErrHandler() Causes a Stack Overflow on Linux
alitvinov
parents:
11093
diff
changeset
|
2 |
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
#ifndef _AWT_UTIL_H_ |
|
27 |
#define _AWT_UTIL_H_ |
|
28 |
||
29 |
#ifndef HEADLESS |
|
30 |
#include "gdefs.h" |
|
31 |
||
21939 | 32 |
#define WITH_XERROR_HANDLER(f) do { \ |
33 |
XSync(awt_display, False); \ |
|
34 |
current_native_xerror_handler = (f); \ |
|
2 | 35 |
} while (0) |
36 |
||
21939 | 37 |
#define RESTORE_XERROR_HANDLER do { \ |
38 |
XSync(awt_display, False); \ |
|
39 |
current_native_xerror_handler = NULL; \ |
|
40 |
} while (0) |
|
41 |
||
42 |
#define EXEC_WITH_XERROR_HANDLER(f, code) do { \ |
|
43 |
WITH_XERROR_HANDLER(f); \ |
|
44 |
do { \ |
|
45 |
code; \ |
|
46 |
} while (0); \ |
|
47 |
RESTORE_XERROR_HANDLER; \ |
|
17679
a81555868357
8005607: Recursion in J2DXErrHandler() Causes a Stack Overflow on Linux
alitvinov
parents:
11093
diff
changeset
|
48 |
} while (0) |
2 | 49 |
|
50 |
/* |
|
21939 | 51 |
* Called by "ToolkitErrorHandler" function in "XlibWrapper.c" file. |
2 | 52 |
*/ |
21939 | 53 |
extern XErrorHandler current_native_xerror_handler; |
18754
3db51db1e3d5
8015730: PIT: On Linux, OGL=true and fbobject=false leads to deadlock or infinite loop
alitvinov
parents:
17679
diff
changeset
|
54 |
|
2 | 55 |
#endif /* !HEADLESS */ |
56 |
||
57 |
#ifndef INTERSECTS |
|
58 |
#define INTERSECTS(r1_x1,r1_x2,r1_y1,r1_y2,r2_x1,r2_x2,r2_y1,r2_y2) \ |
|
59 |
!((r2_x2 <= r1_x1) ||\ |
|
60 |
(r2_y2 <= r1_y1) ||\ |
|
61 |
(r2_x1 >= r1_x2) ||\ |
|
62 |
(r2_y1 >= r1_y2)) |
|
63 |
#endif |
|
64 |
||
65 |
#ifndef MIN |
|
66 |
#define MIN(a,b) ((a) < (b) ? (a) : (b)) |
|
67 |
#endif |
|
68 |
#ifndef MAX |
|
69 |
#define MAX(a,b) ((a) > (b) ? (a) : (b)) |
|
70 |
#endif |
|
71 |
||
72 |
struct DPos { |
|
73 |
int32_t x; |
|
74 |
int32_t y; |
|
75 |
int32_t mapped; |
|
76 |
void *data; |
|
77 |
void *peer; |
|
78 |
int32_t echoC; |
|
79 |
}; |
|
80 |
||
81 |
extern void awtJNI_ThreadYield(JNIEnv *env); |
|
82 |
||
83 |
/* |
|
84 |
* Functions for accessing fields by name and signature |
|
85 |
*/ |
|
86 |
||
87 |
JNIEXPORT jobject JNICALL |
|
88 |
JNU_GetObjectField(JNIEnv *env, jobject self, const char *name, |
|
89 |
const char *sig); |
|
90 |
||
91 |
JNIEXPORT jboolean JNICALL |
|
92 |
JNU_SetObjectField(JNIEnv *env, jobject self, const char *name, |
|
93 |
const char *sig, jobject val); |
|
94 |
||
95 |
JNIEXPORT jlong JNICALL |
|
96 |
JNU_GetLongField(JNIEnv *env, jobject self, const char *name); |
|
97 |
||
98 |
JNIEXPORT jint JNICALL |
|
99 |
JNU_GetIntField(JNIEnv *env, jobject self, const char *name); |
|
100 |
||
101 |
JNIEXPORT jboolean JNICALL |
|
102 |
JNU_SetIntField(JNIEnv *env, jobject self, const char *name, jint val); |
|
103 |
||
104 |
JNIEXPORT jboolean JNICALL |
|
105 |
JNU_SetLongField(JNIEnv *env, jobject self, const char *name, jlong val); |
|
106 |
||
107 |
JNIEXPORT jboolean JNICALL |
|
108 |
JNU_GetBooleanField(JNIEnv *env, jobject self, const char *name); |
|
109 |
||
110 |
JNIEXPORT jboolean JNICALL |
|
111 |
JNU_SetBooleanField(JNIEnv *env, jobject self, const char *name, jboolean val); |
|
112 |
||
113 |
JNIEXPORT jint JNICALL |
|
114 |
JNU_GetCharField(JNIEnv *env, jobject self, const char *name); |
|
115 |
||
116 |
#endif /* _AWT_UTIL_H_ */ |