Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mstr2 committed Oct 14, 2024
1 parent f157a4b commit d40aa4f
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 154 deletions.
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
/*
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.glass.events;

import com.sun.glass.ui.Window;
import com.sun.glass.ui.WindowControlsOverlay;
import java.lang.annotation.Native;

public class MouseEvent {
@Native final static public int BUTTON_NONE = 211;
@Native final static public int BUTTON_LEFT = 212;
@Native final static public int BUTTON_RIGHT = 213;
@Native final static public int BUTTON_OTHER = 214;
@Native final static public int BUTTON_BACK = 215;
@Native final static public int BUTTON_FORWARD = 216;

@Native final static public int DOWN = 221;
@Native final static public int UP = 222;
@Native final static public int DRAG = 223;
@Native final static public int MOVE = 224;
@Native final static public int ENTER = 225;
@Native final static public int EXIT = 226;
@Native final static public int CLICK = 227; // synthetic

/**
* Artificial WHEEL event type.
* This kind of mouse event is NEVER sent to an app.
* The app must listen to Scroll events instead.
* This identifier is required for internal purposes.
*/
@Native final static public int WHEEL = 228;

/**
* Non-client events are only natively produced on the Windows platform as a result of
* handling the {@code WM_NCHITTEST} message for an {@link Window#EXTENDED} window.
* <p>
* They are never sent to applications, but are processed by {@link WindowControlsOverlay}.
*/
@Native final static public int NC_DOWN = 230;
@Native final static public int NC_UP = 231;
@Native final static public int NC_DRAG = 232;
@Native final static public int NC_MOVE = 233;
@Native final static public int NC_ENTER = 234;
@Native final static public int NC_EXIT = 235;

public static boolean isNonClientEvent(int event) {
return event >= NC_DOWN && event <= NC_EXIT;
}

public static int toNonClientEvent(int event) {
return switch (event) {
case DOWN -> NC_DOWN;
case UP -> NC_UP;
case DRAG -> NC_DRAG;
case MOVE -> NC_MOVE;
case ENTER -> NC_ENTER;
case EXIT -> NC_EXIT;
default -> event;
};
}
}
/*
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.glass.events;

import com.sun.glass.ui.Window;
import com.sun.glass.ui.WindowControlsOverlay;
import java.lang.annotation.Native;

public class MouseEvent {
@Native final static public int BUTTON_NONE = 211;
@Native final static public int BUTTON_LEFT = 212;
@Native final static public int BUTTON_RIGHT = 213;
@Native final static public int BUTTON_OTHER = 214;
@Native final static public int BUTTON_BACK = 215;
@Native final static public int BUTTON_FORWARD = 216;

@Native final static public int DOWN = 221;
@Native final static public int UP = 222;
@Native final static public int DRAG = 223;
@Native final static public int MOVE = 224;
@Native final static public int ENTER = 225;
@Native final static public int EXIT = 226;
@Native final static public int CLICK = 227; // synthetic

/**
* Artificial WHEEL event type.
* This kind of mouse event is NEVER sent to an app.
* The app must listen to Scroll events instead.
* This identifier is required for internal purposes.
*/
@Native final static public int WHEEL = 228;

/**
* Non-client events are only natively produced on the Windows platform as a result of
* handling the {@code WM_NCHITTEST} message for an {@link Window#EXTENDED} window.
* <p>
* They are never sent to applications, but are processed by {@link WindowControlsOverlay}.
*/
@Native final static public int NC_DOWN = 230;
@Native final static public int NC_UP = 231;
@Native final static public int NC_DRAG = 232;
@Native final static public int NC_MOVE = 233;
@Native final static public int NC_ENTER = 234;
@Native final static public int NC_EXIT = 235;

public static boolean isNonClientEvent(int event) {
return event >= NC_DOWN && event <= NC_EXIT;
}

public static int toNonClientEvent(int event) {
return switch (event) {
case DOWN -> NC_DOWN;
case UP -> NC_UP;
case DRAG -> NC_DRAG;
case MOVE -> NC_MOVE;
case ENTER -> NC_ENTER;
case EXIT -> NC_EXIT;
default -> event;
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,6 @@ void ViewContainer::NotifyCaptureChanged(HWND hwnd, HWND to)

void ViewContainer::ResetMouseTracking(HWND hwnd)
{
return;
if (!m_bTrackingMouse) {
return;
}
Expand Down
138 changes: 69 additions & 69 deletions modules/javafx.graphics/src/main/native-glass/win/common.h
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
/*
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

#ifndef _GLASS_COMMON_
#define _GLASS_COMMON_

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0601
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
#endif

#ifndef _WIN32_WINNT_
#define _WIN32_WINNT_ _WIN32_WINNT
#endif

#pragma warning(disable : 4675)

#include <assert.h>
#include <comdef.h>
#include <comutil.h>
#include <imm.h>
#include <jni.h>
#include <malloc.h>
#include <manipulations.h>
#include <memory>
#include <mmsystem.h>
#include <new>
#include <ole2.h>
#include <shlobj.h>
#include <stdio.h>
#include <string.h>
#include <Tpcshrd.h>
#include <tchar.h>
#include <vector>
#include <wchar.h>
#include <windows.h>
#include <windowsx.h>
#include <shellapi.h>
#include <versionhelpers.h>

#include "Utils.h"
#include "OleUtils.h"
#include "Dwmapi.h"

#endif /* #ifndef _GLASS_COMMON_ */
/*
* Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

#ifndef _GLASS_COMMON_
#define _GLASS_COMMON_

#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0601
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
#endif

#ifndef _WIN32_WINNT_
#define _WIN32_WINNT_ _WIN32_WINNT
#endif

#pragma warning(disable : 4675)

#include <assert.h>
#include <comdef.h>
#include <comutil.h>
#include <imm.h>
#include <jni.h>
#include <malloc.h>
#include <manipulations.h>
#include <memory>
#include <mmsystem.h>
#include <new>
#include <ole2.h>
#include <shlobj.h>
#include <stdio.h>
#include <string.h>
#include <Tpcshrd.h>
#include <tchar.h>
#include <vector>
#include <wchar.h>
#include <windows.h>
#include <windowsx.h>
#include <shellapi.h>
#include <versionhelpers.h>

#include "Utils.h"
#include "OleUtils.h"
#include "Dwmapi.h"

#endif /* #ifndef _GLASS_COMMON_ */

0 comments on commit d40aa4f

Please sign in to comment.