Path: blob/master/src/java.desktop/share/native/libawt/java2d/pipe/PathConsumer2D.h
41159 views
/*1* Copyright (c) 2007, 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_PathConsumer2D26#define _Included_PathConsumer2D2728/* For forward referencing - struct defined below. */29struct _PathConsumerVec;3031/*32* Note on Error Conditions:33* The following functions all return true on an error condition which34* precludes any further processing. The module calling these functions35* should cease the operation and invoke its own error handling.36* The return value is the only indication of the error, no exceptions37* should be thrown by the consumer - the caller is solely responsible38* for reporting the error/exception.39* The most common cause of failure is an allocation failure so a40* true return code could be reported as an "out of memory" error41* if so desired.42* No cleanup of the native consumer is required upon either a successful43* completion of the path or upon an error return. Such cleanup will44* be handled elsewhere via other mechanisms (finalization, try/finally,45* etc.)46*/4748/* See GeneralPath.moveTo - returns true on error condition. */49typedef jboolean (MoveToFunc)(struct _PathConsumerVec *pVec,50jfloat x0, jfloat y0);51/* See GeneralPath.lineTo - returns true on error condition. */52typedef jboolean (LineToFunc)(struct _PathConsumerVec *pVec,53jfloat x1, jfloat y1);54/* See GeneralPath.quadTo - returns true on error condition. */55typedef jboolean (QuadToFunc)(struct _PathConsumerVec *pVec,56jfloat xm, jfloat ym,57jfloat x1, jfloat y1);58/* See GeneralPath.curveTo - returns true on error condition. */59typedef jboolean (CubicToFunc)(struct _PathConsumerVec *pVec,60jfloat xm0, jfloat ym0,61jfloat xm1, jfloat ym1,62jfloat x1, jfloat y1);63/* See GeneralPath.closePath - returns true on error condition. */64typedef jboolean (ClosePathFunc)(struct _PathConsumerVec *pVec);6566/*67* This function must be called after the last segment of the last68* subpath is sent to the above methods. No further calls should69* be made to any of the PathConsumerVec functions subsequently.70*/71typedef jboolean (PathDoneFunc)(struct _PathConsumerVec *pVec);7273/*74* This structure defines the list of function pointers for implementations75* of the above specified functions. A pointer to this structure is also76* handed to each function as its first parameter. If the implementation77* needs private context-specific data then it can be stored adjacent to78* the PathConsumerVec structure in the same allocated storage.79*/80typedef struct _PathConsumerVec {81MoveToFunc *moveTo;82LineToFunc *lineTo;83QuadToFunc *quadTo;84CubicToFunc *cubicTo;85ClosePathFunc *closePath;86PathDoneFunc *pathDone;87} PathConsumerVec;8889#endif909192