1 /*
   2  * Copyright (c) 2005, 2015, Oracle and/or its affiliates. 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.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * @(#)JavaFerret.h     1.3 05/03/21
  28  */
  29 
  30 #define JAVA_FERRET_LOG "JavaFerret.log"
  31 
  32 void CALLBACK TimerProc(HWND hWnd, UINT uTimerMsg, UINT uTimerID, DWORD dwTime);
  33 LRESULT CALLBACK KeyboardProc (int code, WPARAM wParam, LPARAM lParam);
  34 LRESULT CALLBACK MouseProc (int code, WPARAM wParam, LPARAM lParam);
  35 
  36 BOOL InitWindow (HANDLE hInstance);
  37 BOOL APIENTRY FerretDialogProc (HWND hDlg, UINT message, UINT wParam, LONG lParam);
  38 
  39 void HandleJavaPropertyChange(long vmID, PropertyChangeEvent event,
  40                               AccessibleContext ac,
  41                               wchar_t *name, wchar_t *oldValue, wchar_t *newValue);
  42 
  43 void HandleJavaShutdown(long vmID);
  44 void HandleJavaFocusGained(long vmID, FocusEvent event, AccessibleContext ac);
  45 void HandleJavaFocusLost(long vmID, FocusEvent event, AccessibleContext ac);
  46 
  47 void HandleJavaCaretUpdate(long vmID, CaretEvent event, AccessibleContext ac);
  48 
  49 void HandleMouseClicked(long vmID, MouseEvent event, AccessibleContext ac);
  50 void HandleMouseEntered(long vmID, MouseEvent event, AccessibleContext ac);
  51 void HandleMouseExited(long vmID, MouseEvent event, AccessibleContext ac);
  52 void HandleMousePressed(long vmID, MouseEvent event, AccessibleContext ac);
  53 void HandleMouseReleased(long vmID, MouseEvent event, AccessibleContext ac);
  54 
  55 void HandleMenuCanceled(long vmID, MenuEvent event, AccessibleContext ac);
  56 void HandleMenuDeselected(long vmID, MenuEvent event, AccessibleContext ac);
  57 void HandleMenuSelected(long vmID, MenuEvent event, AccessibleContext ac);
  58 void HandlePopupMenuCanceled(long vmID, MenuEvent event, AccessibleContext ac);
  59 void HandlePopupMenuWillBecomeInvisible(long vmID, MenuEvent event, AccessibleContext ac);
  60 void HandlePopupMenuWillBecomeVisible(long vmID, MenuEvent event, AccessibleContext ac);
  61 
  62 void HandlePropertyNameChange(long vmID, PropertyChangeEvent event, AccessibleContext ac,
  63                               wchar_t *oldName, wchar_t *newName);
  64 void HandlePropertyDescriptionChange(long vmID, PropertyChangeEvent event, AccessibleContext ac,
  65                                      wchar_t *oldDescription, wchar_t *newDescription);
  66 void HandlePropertyStateChange(long vmID, PropertyChangeEvent event, AccessibleContext ac,
  67                                wchar_t *oldState, wchar_t *newState);
  68 void HandlePropertyValueChange(long vmID, PropertyChangeEvent event, AccessibleContext ac,
  69                                wchar_t *oldValue, wchar_t *newValue);
  70 void HandlePropertySelectionChange(long vmID, PropertyChangeEvent event, AccessibleContext ac);
  71 void HandlePropertyTextChange(long vmID, PropertyChangeEvent event, AccessibleContext ac);
  72 void HandlePropertyCaretChange(long vmID, PropertyChangeEvent event, AccessibleContext ac,
  73                                int oldPosition, int newPosition);
  74 void HandlePropertyVisibleDataChange(long vmID, PropertyChangeEvent event, AccessibleContext ac);
  75 void HandlePropertyChildChange(long vmID, PropertyChangeEvent event, AccessibleContext ac,
  76                                jobject oldChild, jobject newChild);
  77 void HandlePropertyActiveDescendentChange(long vmID, PropertyChangeEvent event,
  78                                           AccessibleContext ac,
  79                                           jobject oldActiveDescendent,
  80                                           jobject newActiveDescendent);
  81 
  82 void HandlePropertyTableModelChange(long vmID, PropertyChangeEvent event,
  83                                     AccessibleContext ac,
  84                                     wchar_t *oldValue, wchar_t *newValue);
  85 
  86 char *getAccessibleInfo(long vmID, AccessibleContext ac,
  87                         int x, int y, char *buffer, int bufsize);
  88 
  89 char *getTimeAndDate();
  90 void displayAndLogText(char *buffer, ...);