Path: blob/master/src/jdk.accessibility/windows/native/libjavaaccessbridge/JavaAccessBridge.h
40957 views
/*1* Copyright (c) 2005, 2015, 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/*26* A DLL which is loaded by Java applications to handle communication27* between Java VMs purposes of Accessbility.28*/2930#include <windows.h>31#include <jni.h>3233#include "AccessBridgePackages.h"34#include "AccessBridgeATInstance.h"35#include "AccessBridgeJavaEntryPoints.h"3637#ifndef __JavaAccessBridge_H__38#define __JavaAccessBridge_H__394041extern "C" {42BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason,43LPVOID lpvReserved);44void AppendToCallOutput(char *s);45BOOL APIENTRY AccessBridgeDialogProc(HWND hDlg, UINT message,46WPARAM wParam, LPARAM lParam);47}4849/**50* The JavaAccessBridge class. The core of the Windows AT AccessBridge dll51*/52class JavaAccessBridge {53// for debugging54public:55// for debugging56HINSTANCE windowsInstance;57HWND dialogWindow;58AccessBridgeATInstance *ATs;59JavaVM *javaVM;60JNIEnv *windowsThreadJNIEnv; // for calls initiated from Windows61AccessBridgeJavaEntryPoints *javaThreadEntryPoints;62AccessBridgeJavaEntryPoints *windowsThreadEntryPoints;63jobject javaThreadABObject; // for calls initiated from Java64jobject windowsThreadABObject; // for calls initiated from Windows6566public:67JavaAccessBridge(HINSTANCE hInstance);68~JavaAccessBridge();69void javaRun(JNIEnv *env, jobject obj);70BOOL initWindow();7172// IPC with the Java AccessBridge DLL73void postHelloToWindowsDLLMsg(HWND destHwnd);74LRESULT MemoryMappedFileCreated(HWND srcHwnd, char *filename);7576void sendPackage(char *buffer, int bufsize, HWND destHwnd);77void sendJavaEventPackage(char *buffer, int bufsize, long type);78void sendAccessibilityEventPackage(char *buffer, int bufsize, long type);79BOOL sendMemoryPackage(char *buffer, long bufsize, HWND destWindow);80LRESULT processPackage(char *buffer, int bufsize);81BOOL receiveMemoryPackage(HWND srcWindow, long bufsize);82void WindowsATDestroyed(HWND ATBridgeDLLWindow);8384// Java VM object memory management85void releaseJavaObject(jobject object);8687// Event handling methods88void addJavaEventNotification(jlong type, HWND DLLwindow);89void removeJavaEventNotification(jlong type, HWND DLLwindow);90void addAccessibilityEventNotification(jlong type, HWND DLLwindow);91void removeAccessibilityEventNotification(jlong type, HWND DLLwindow);9293// Event firing methods94/*95void firePropertyChange(JNIEnv *env, jobject callingObj,96jobject propertyChangeEvent,97jobject source, jstring propertyName,98jstring oldValue, jstring newValue);99*/100101void javaShutdown(JNIEnv *env, jobject callingObj);102103void fireFocusGained(JNIEnv *env, jobject callingObj,104jobject focusEvent, jobject source);105void fireFocusLost(JNIEnv *env, jobject callingObj,106jobject focusEvent,jobject source);107void fireCaretUpdate(JNIEnv *env, jobject callingObj,108jobject caretEvent, jobject source);109void fireMouseClicked(JNIEnv *env, jobject callingObj,110jobject mouseEvent, jobject source);111void fireMouseEntered(JNIEnv *env, jobject callingObj,112jobject mouseEvent, jobject source);113void fireMouseExited(JNIEnv *env, jobject callingObj,114jobject mouseEvent, jobject source);115void fireMousePressed(JNIEnv *env, jobject callingObj,116jobject mouseEvent, jobject source);117void fireMouseReleased(JNIEnv *env, jobject callingObj,118jobject mouseEvent, jobject source);119void fireMenuCanceled(JNIEnv *env, jobject callingObj,120jobject menuEvent, jobject source);121void fireMenuDeselected(JNIEnv *env, jobject callingObj,122jobject menuEvent, jobject source);123void fireMenuSelected(JNIEnv *env, jobject callingObj,124jobject menuEvent, jobject source);125void firePopupMenuCanceled(JNIEnv *env, jobject callingObj,126jobject popupMenuEvent, jobject source);127void firePopupMenuWillBecomeInvisible(JNIEnv *env, jobject callingObj,128jobject popupMenuEvent, jobject source);129void firePopupMenuWillBecomeVisible(JNIEnv *env, jobject callingObj,130jobject popupMenuEvent, jobject source);131132void firePropertyCaretChange(JNIEnv *env, jobject callingObj,133jobject event, jobject source,134jint oldValue, jint newValue);135void firePropertyDescriptionChange(JNIEnv *env, jobject callingObj,136jobject event, jobject source,137jstring oldValue, jstring newValue);138void firePropertyNameChange(JNIEnv *env, jobject callingObj,139jobject event, jobject source,140jstring oldValue, jstring newValue);141void firePropertySelectionChange(JNIEnv *env, jobject callingObj,142jobject event, jobject source);143void firePropertyStateChange(JNIEnv *env, jobject callingObj,144jobject event, jobject source,145jstring oldValue, jstring newValue);146void firePropertyTextChange(JNIEnv *env, jobject callingObj,147jobject event, jobject source);148void firePropertyValueChange(JNIEnv *env, jobject callingObj,149jobject event, jobject source,150jstring oldValue, jstring newValue);151void firePropertyVisibleDataChange(JNIEnv *env, jobject callingObj,152jobject event, jobject source);153void firePropertyChildChange(JNIEnv *env, jobject callingObj,154jobject event, jobject source,155jobject oldValue, jobject newValue);156void firePropertyActiveDescendentChange(JNIEnv *env, jobject callingObj,157jobject event, jobject source,158jobject oldValue, jobject newValue);159160void firePropertyTableModelChange(JNIEnv *env, jobject callingObj,161jobject event, jobject source,162jstring oldValue, jstring newValue);163};164165166#endif167168169