< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_DnDDS.h

Print this page
rev 58018 : 8238575: DragSourceEvent.getLocation() returns wrong value on HiDPI screens (Windows)
Reviewed-by: XXX
   1 /*
   2  * Copyright (c) 1997, 2009, 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


 110         INLINE void WaitUntilSignalled(BOOL retain) {
 111             do {
 112                 // nothing ...
 113             } while(::WaitForSingleObject(m_mutex, INFINITE) == WAIT_FAILED);
 114 
 115             if (!retain) ::ReleaseMutex(m_mutex);
 116         }
 117 
 118         static void _DoDragDrop(void* param);
 119 
 120         HRESULT __stdcall MatchFormatEtc(FORMATETC __RPC_FAR *pFormatEtcIn, FORMATETC *cacheEnt);
 121 
 122    private:
 123 
 124         void LoadCache(jlongArray formats);
 125         void UnloadCache();
 126 
 127         static int __cdecl _compar(const void *, const void *);
 128 
 129         static void call_dSCenter(JNIEnv* env, jobject self, jint targetActions,
 130                                   jint modifiers, jint x, jint y);
 131         static void call_dSCmotion(JNIEnv* env, jobject self,
 132                                    jint targetActions, jint modifiers,
 133                                    jint x, jint y);
 134         static void call_dSCchanged(JNIEnv* env, jobject self,
 135                                     jint targetActions, jint modifiers,
 136                                     jint x, jint y);
 137         static void call_dSCmouseMoved(JNIEnv* env, jobject self,
 138                                        jint targetActions, jint modifiers,
 139                                        jint x, jint y);
 140         static void call_dSCexit(JNIEnv* env, jobject self, jint x, jint y);
 141         static void call_dSCddfinished(JNIEnv* env, jobject self,
 142                                        jboolean success, jint operations,
 143                                        jint x, jint y);
 144     protected:
 145 
 146         class ADSIEnumFormatEtc : public virtual IEnumFORMATETC {
 147             public:
 148                 ADSIEnumFormatEtc(AwtDragSource* parent);
 149 
 150                 virtual ~ADSIEnumFormatEtc();
 151 
 152                 // IUnknown
 153 
 154                 virtual HRESULT __stdcall QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject);
 155 
 156                 virtual ULONG   __stdcall AddRef(void);
 157                 virtual ULONG   __stdcall Release(void);
 158 
 159                 // IEnumFORMATETC
 160 
 161                 virtual HRESULT _stdcall Next(ULONG celt, FORMATETC __RPC_FAR *rgelt, ULONG __RPC_FAR *pceltFetched);
 162                 virtual HRESULT _stdcall Skip(ULONG celt);
 163                 virtual HRESULT _stdcall Reset();


 237         jint            m_lastmods;
 238 
 239         HWND            m_droptarget;
 240         int             m_enterpending;
 241 
 242         jint            m_actions;
 243 
 244         FORMATETC*      m_types;
 245         unsigned int    m_ntypes;
 246 
 247         ULONG           m_refs;
 248 
 249         AwtCursor*      m_cursor;
 250 
 251         HANDLE          m_mutex;
 252 
 253         jobject         m_component;
 254         jobject         m_transferable;
 255         jobject         m_formatMap;
 256 
 257         POINT           m_dragPoint;
 258         POINT           m_dropPoint;
 259         BOOL            m_fNC;
 260         BOOL            m_bRestoreNodropCustomCursor;//CR 6480706 - MS Bug on hold
 261 
 262         DWORD           m_dwPerformedDropEffect;
 263 
 264         // static's ...
 265 
 266         static jclass           dSCClazz;
 267         static jclass           awtIEClazz;
 268 
 269         static jmethodID        dSCdragenter;
 270         static jmethodID        dSCdragmotion;
 271         static jmethodID        dSCopschanged;
 272         static jmethodID        dSCdragexit;
 273         static jmethodID        dSCddfinish;
 274 
 275         static jfieldID         awtIEmods;
 276 };
 277 
 278 extern const CLIPFORMAT CF_PERFORMEDDROPEFFECT;
   1 /*
   2  * Copyright (c) 1997, 2020, 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


 110         INLINE void WaitUntilSignalled(BOOL retain) {
 111             do {
 112                 // nothing ...
 113             } while(::WaitForSingleObject(m_mutex, INFINITE) == WAIT_FAILED);
 114 
 115             if (!retain) ::ReleaseMutex(m_mutex);
 116         }
 117 
 118         static void _DoDragDrop(void* param);
 119 
 120         HRESULT __stdcall MatchFormatEtc(FORMATETC __RPC_FAR *pFormatEtcIn, FORMATETC *cacheEnt);
 121 
 122    private:
 123 
 124         void LoadCache(jlongArray formats);
 125         void UnloadCache();
 126 
 127         static int __cdecl _compar(const void *, const void *);
 128 
 129         static void call_dSCenter(JNIEnv* env, jobject self, jint targetActions,
 130                                   jint modifiers, POINT pt);
 131         static void call_dSCmotion(JNIEnv* env, jobject self,
 132                                    jint targetActions, jint modifiers,
 133                                    POINT pt);
 134         static void call_dSCchanged(JNIEnv* env, jobject self,
 135                                     jint targetActions, jint modifiers,
 136                                     POINT pt);
 137         static void call_dSCmouseMoved(JNIEnv* env, jobject self,
 138                                        jint targetActions, jint modifiers,
 139                                        POINT pt);
 140         static void call_dSCexit(JNIEnv* env, jobject self, POINT pt);
 141         static void call_dSCddfinished(JNIEnv* env, jobject self,
 142                                        jboolean success, jint operations,
 143                                        POINT pt);
 144     protected:
 145 
 146         class ADSIEnumFormatEtc : public virtual IEnumFORMATETC {
 147             public:
 148                 ADSIEnumFormatEtc(AwtDragSource* parent);
 149 
 150                 virtual ~ADSIEnumFormatEtc();
 151 
 152                 // IUnknown
 153 
 154                 virtual HRESULT __stdcall QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject);
 155 
 156                 virtual ULONG   __stdcall AddRef(void);
 157                 virtual ULONG   __stdcall Release(void);
 158 
 159                 // IEnumFORMATETC
 160 
 161                 virtual HRESULT _stdcall Next(ULONG celt, FORMATETC __RPC_FAR *rgelt, ULONG __RPC_FAR *pceltFetched);
 162                 virtual HRESULT _stdcall Skip(ULONG celt);
 163                 virtual HRESULT _stdcall Reset();


 237         jint            m_lastmods;
 238 
 239         HWND            m_droptarget;
 240         int             m_enterpending;
 241 
 242         jint            m_actions;
 243 
 244         FORMATETC*      m_types;
 245         unsigned int    m_ntypes;
 246 
 247         ULONG           m_refs;
 248 
 249         AwtCursor*      m_cursor;
 250 
 251         HANDLE          m_mutex;
 252 
 253         jobject         m_component;
 254         jobject         m_transferable;
 255         jobject         m_formatMap;
 256 
 257         POINT           m_dragPoint; // device space (pixels)
 258         POINT           m_dropPoint; // device space (pixels)
 259         BOOL            m_fNC;
 260         BOOL            m_bRestoreNodropCustomCursor;//CR 6480706 - MS Bug on hold
 261 
 262         DWORD           m_dwPerformedDropEffect;
 263 
 264         // static's ...
 265 
 266         static jclass           dSCClazz;
 267         static jclass           awtIEClazz;
 268 
 269         static jmethodID        dSCdragenter;
 270         static jmethodID        dSCdragmotion;
 271         static jmethodID        dSCopschanged;
 272         static jmethodID        dSCdragexit;
 273         static jmethodID        dSCddfinish;
 274 
 275         static jfieldID         awtIEmods;
 276 };
 277 
 278 extern const CLIPFORMAT CF_PERFORMEDDROPEFFECT;
< prev index next >