Path: blob/master/src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.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#include <windows.h> // includes basic windows functionality26#include <stdio.h>27#include <commctrl.h>28#include <jni.h>29#include "jaccesswalkerResource.h"30#include "AccessBridgeCalls.h"31#include "AccessBridgeCallbacks.h"32#include "AccessBridgeDebug.h"3334#include <windows.h>35#include <stdio.h>36#include <stdlib.h>37#include <io.h>38#include <direct.h>39#include <process.h>4041#include <time.h>4243extern FILE *file;4445#define null NULL46#define JACCESSWALKER_LOG "jaccesswalker.log"4748/**49* A node in the jaccesswalker tree50*/51class AccessibleNode {5253HWND baseHWND;54HTREEITEM treeNodeParent;55long vmID;56AccessibleContext ac;57AccessibleNode *parentNode;58char accessibleName[MAX_STRING_SIZE];59char accessibleRole[SHORT_STRING_SIZE];6061public:62AccessibleNode(long vmID, AccessibleContext context,63AccessibleNode *parent, HWND hWnd,64HTREEITEM parentTreeNodeItem);65~AccessibleNode();66void setAccessibleName(char *name);67void setAccessibleRole(char *role);68BOOL displayAPIWindow(); // bring up an Accessibility API detail window69};707172/**73* The main application class74*/75class Jaccesswalker {7677public:78Jaccesswalker(int nCmdShow);79BOOL InitWindow(int windowMode);80char *getAccessibleInfo( long vmID, AccessibleContext ac, char *buffer,81int bufsize );82void exitjaccesswalker(HWND hWnd);83void buildAccessibilityTree();84void addComponentNodes( long vmID, AccessibleContext context,85AccessibleNode *parent, HWND hWnd,86HTREEITEM treeNodeParent, HWND treeWnd );87};8889char *getTimeAndDate();9091void displayAndLogText(char *buffer, ...);9293LRESULT CALLBACK WinProc (HWND, UINT, WPARAM, LPARAM);9495void debugString(char *msg, ...);9697LRESULT CALLBACK jaccesswalkerWindowProc( HWND hDlg, UINT message, UINT wParam,98LONG lParam );99100BOOL CALLBACK EnumWndProc(HWND hWnd, LPARAM lParam);101BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam);102103HWND CreateATreeView(HWND hwndParent);104105LRESULT CALLBACK AccessInfoWindowProc( HWND hWnd, UINT message, UINT wParam,106LONG lParam );107108char *getAccessibleInfo( long vmID, AccessibleContext ac, char *buffer,109int bufsize );110111112