blob: ca482b48d44ee3cdf16cc73e4e0190f7c7cd4c2a [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
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
29void awt_canvas_reconfigure(struct FrameData *wdata);
30Widget 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);
38void awt_canvas_scroll(XtPointer this, struct CanvasData *wdata, long dx, long dy);
39void awt_canvas_event_handler(Widget w, XtPointer client_data,
40 XEvent *event, Boolean *cont);
41void awt_canvas_handleEvent(Widget w, XtPointer client_data,
42 XEvent *event, struct WidgetInfo *winfo,
43 Boolean *cont, Boolean passEvent);
44
45void awt_copyXEventToAWTEvent(JNIEnv* env, XEvent * xevent, jobject jevent);
46KeySym awt_getX11KeySym(jint awtKey);
47jobject awt_canvas_getFocusOwnerPeer();
48jobject awt_canvas_getFocusedWindowPeer();
49void awt_canvas_setFocusOwnerPeer(jobject peer);
50void awt_canvas_setFocusedWindowPeer(jobject peer);
51jobject awt_canvas_wrapInSequenced(jobject awtevent);
52extern void keysymToAWTKeyCode(KeySym x11Key, jint *keycode, Boolean *mapsToUnicodeChar,
53 jint *keyLocation);
54#define awt_canvas_addToFocusList awt_canvas_addToFocusListDefault
55void awt_canvas_addToFocusListDefault(jobject target);
56void awt_canvas_addToFocusListWithDuplicates(jobject target, jboolean acceptDuplicate);
57extern void callFocusCallback(jobject focusPeer, int focus_type, jobject cause);
58extern void callFocusHandler(Widget w, int eventType, jobject cause);
59
60typedef struct FocusListElt{
61 jweak requestor;
62 struct FocusListElt * next;
63} FocusListElt;
64extern FocusListElt *focusList;
65extern FocusListElt *focusListEnd;
66extern jweak forGained;
67
68#endif /* !HEADLESS */
69#endif /* _CANVAS_H_ */