Path: blob/master/src/java.desktop/share/native/libawt/java2d/Trace.h
41152 views
/*1* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef _Included_Trace26#define _Included_Trace2728#include <jni.h>29#include "debug_trace.h"3031#ifdef __cplusplus32extern "C" {33#endif /* __cplusplus */3435/**36* J2dTrace37* Trace utility used throughout Java 2D code. Uses a "level"38* parameter that allows user to specify how much detail39* they want traced at runtime. Tracing is only enabled40* in debug mode, to avoid overhead running release build.41*/4243#define J2D_TRACE_INVALID -144#define J2D_TRACE_OFF 045#define J2D_TRACE_ERROR 146#define J2D_TRACE_WARNING 247#define J2D_TRACE_INFO 348#define J2D_TRACE_VERBOSE 449#define J2D_TRACE_VERBOSE2 550#define J2D_TRACE_MAX (J2D_TRACE_VERBOSE2+1)5152JNIEXPORT void JNICALL53J2dTraceImpl(int level, jboolean cr, const char *string, ...);54JNIEXPORT void JNICALL55J2dTraceInit();5657#ifndef DEBUG58#define J2dTrace(level, string)59#define J2dTrace1(level, string, arg1)60#define J2dTrace2(level, string, arg1, arg2)61#define J2dTrace3(level, string, arg1, arg2, arg3)62#define J2dTrace4(level, string, arg1, arg2, arg3, arg4)63#define J2dTrace5(level, string, arg1, arg2, arg3, arg4, arg5)64#define J2dTrace6(level, string, arg1, arg2, arg3, arg4, arg5, arg6)65#define J2dTrace7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7)66#define J2dTrace8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)67#define J2dTraceLn(level, string)68#define J2dTraceLn1(level, string, arg1)69#define J2dTraceLn2(level, string, arg1, arg2)70#define J2dTraceLn3(level, string, arg1, arg2, arg3)71#define J2dTraceLn4(level, string, arg1, arg2, arg3, arg4)72#define J2dTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5)73#define J2dTraceLn6(level, string, arg1, arg2, arg3, arg4, arg5, arg6)74#define J2dTraceLn7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7)75#define J2dTraceLn8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)76#else /* DEBUG */77#define J2dTrace(level, string) { \78J2dTraceImpl(level, JNI_FALSE, string); \79}80#define J2dTrace1(level, string, arg1) { \81J2dTraceImpl(level, JNI_FALSE, string, arg1); \82}83#define J2dTrace2(level, string, arg1, arg2) { \84J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2); \85}86#define J2dTrace3(level, string, arg1, arg2, arg3) { \87J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3); \88}89#define J2dTrace4(level, string, arg1, arg2, arg3, arg4) { \90J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4); \91}92#define J2dTrace5(level, string, arg1, arg2, arg3, arg4, arg5) { \93J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5); \94}95#define J2dTrace6(level, string, arg1, arg2, arg3, arg4, arg5, arg6) { \96J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6); \97}98#define J2dTrace7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \99J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \100}101#define J2dTrace8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { \102J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \103}104#define J2dTraceLn(level, string) { \105J2dTraceImpl(level, JNI_TRUE, string); \106}107#define J2dTraceLn1(level, string, arg1) { \108J2dTraceImpl(level, JNI_TRUE, string, arg1); \109}110#define J2dTraceLn2(level, string, arg1, arg2) { \111J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2); \112}113#define J2dTraceLn3(level, string, arg1, arg2, arg3) { \114J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3); \115}116#define J2dTraceLn4(level, string, arg1, arg2, arg3, arg4) { \117J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4); \118}119#define J2dTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5) { \120J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5); \121}122#define J2dTraceLn6(level, string, arg1, arg2, arg3, arg4, arg5, arg6) { \123J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6); \124}125#define J2dTraceLn7(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \126J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \127}128#define J2dTraceLn8(level, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) { \129J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \130}131#endif /* DEBUG */132133134/**135* NOTE: Use the following RlsTrace calls very carefully; they are compiled136* into the code and should thus not be put in any performance-sensitive137* areas.138*/139140#define J2dRlsTrace(level, string) { \141J2dTraceImpl(level, JNI_FALSE, string); \142}143#define J2dRlsTrace1(level, string, arg1) { \144J2dTraceImpl(level, JNI_FALSE, string, arg1); \145}146#define J2dRlsTrace2(level, string, arg1, arg2) { \147J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2); \148}149#define J2dRlsTrace3(level, string, arg1, arg2, arg3) { \150J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3); \151}152#define J2dRlsTrace4(level, string, arg1, arg2, arg3, arg4) { \153J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4); \154}155#define J2dRlsTrace5(level, string, arg1, arg2, arg3, arg4, arg5) { \156J2dTraceImpl(level, JNI_FALSE, string, arg1, arg2, arg3, arg4, arg5); \157}158#define J2dRlsTraceLn(level, string) { \159J2dTraceImpl(level, JNI_TRUE, string); \160}161#define J2dRlsTraceLn1(level, string, arg1) { \162J2dTraceImpl(level, JNI_TRUE, string, arg1); \163}164#define J2dRlsTraceLn2(level, string, arg1, arg2) { \165J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2); \166}167#define J2dRlsTraceLn3(level, string, arg1, arg2, arg3) { \168J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3); \169}170#define J2dRlsTraceLn4(level, string, arg1, arg2, arg3, arg4) { \171J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4); \172}173#define J2dRlsTraceLn5(level, string, arg1, arg2, arg3, arg4, arg5) { \174J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5); \175}176177#ifdef __cplusplus178};179#endif /* __cplusplus */180181#endif /* _Included_Trace */182183184