J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1995-2003 Sun Microsystems, Inc. All Rights Reserved. |
| 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 |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 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 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | #ifndef _CANVAS_H_ |
| 26 | #define _CANVAS_H_ |
| 27 | #ifndef HEADLESS |
| 28 | |
| 29 | void awt_canvas_reconfigure(struct FrameData *wdata); |
| 30 | Widget awt_canvas_create(XtPointer this, |
| 31 | Widget parent, |
| 32 | char *base, |
| 33 | int32_t width, |
| 34 | int32_t height, |
| 35 | Boolean parentIsFrame, |
| 36 | struct FrameData *wdata, |
| 37 | AwtGraphicsConfigDataPtr awtData); |
| 38 | void awt_canvas_scroll(XtPointer this, struct CanvasData *wdata, long dx, long dy); |
| 39 | void awt_canvas_event_handler(Widget w, XtPointer client_data, |
| 40 | XEvent *event, Boolean *cont); |
| 41 | void awt_canvas_handleEvent(Widget w, XtPointer client_data, |
| 42 | XEvent *event, struct WidgetInfo *winfo, |
| 43 | Boolean *cont, Boolean passEvent); |
| 44 | |
| 45 | void awt_copyXEventToAWTEvent(JNIEnv* env, XEvent * xevent, jobject jevent); |
| 46 | KeySym awt_getX11KeySym(jint awtKey); |
| 47 | jobject awt_canvas_getFocusOwnerPeer(); |
| 48 | jobject awt_canvas_getFocusedWindowPeer(); |
| 49 | void awt_canvas_setFocusOwnerPeer(jobject peer); |
| 50 | void awt_canvas_setFocusedWindowPeer(jobject peer); |
| 51 | jobject awt_canvas_wrapInSequenced(jobject awtevent); |
| 52 | extern void keysymToAWTKeyCode(KeySym x11Key, jint *keycode, Boolean *mapsToUnicodeChar, |
| 53 | jint *keyLocation); |
| 54 | #define awt_canvas_addToFocusList awt_canvas_addToFocusListDefault |
| 55 | void awt_canvas_addToFocusListDefault(jobject target); |
| 56 | void awt_canvas_addToFocusListWithDuplicates(jobject target, jboolean acceptDuplicate); |
| 57 | extern void callFocusCallback(jobject focusPeer, int focus_type, jobject cause); |
| 58 | extern void callFocusHandler(Widget w, int eventType, jobject cause); |
| 59 | |
| 60 | typedef struct FocusListElt{ |
| 61 | jweak requestor; |
| 62 | struct FocusListElt * next; |
| 63 | } FocusListElt; |
| 64 | extern FocusListElt *focusList; |
| 65 | extern FocusListElt *focusListEnd; |
| 66 | extern jweak forGained; |
| 67 | |
| 68 | #endif /* !HEADLESS */ |
| 69 | #endif /* _CANVAS_H_ */ |