mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 21:56:36 +00:00
Code clean up.
Remove unused code.
This commit is contained in:
parent
da06b86c63
commit
2c85af81e7
@ -114,15 +114,8 @@
|
|||||||
#define IS_POINTER_INCONTACT_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM(wParam, POINTER_MESSAGE_FLAG_INCONTACT)
|
#define IS_POINTER_INCONTACT_WPARAM(wParam) IS_POINTER_FLAG_SET_WPARAM(wParam, POINTER_MESSAGE_FLAG_INCONTACT)
|
||||||
#define IS_POINTER_FLAG_SET_WPARAM(wParam, flag) (((DWORD)HIWORD(wParam) & (flag)) == (flag))
|
#define IS_POINTER_FLAG_SET_WPARAM(wParam, flag) (((DWORD)HIWORD(wParam) & (flag)) == (flag))
|
||||||
|
|
||||||
|
typedef enum
|
||||||
typedef DWORD POINTER_INPUT_TYPE;
|
{
|
||||||
typedef UINT32 POINTER_FLAGS;
|
|
||||||
typedef UINT32 PEN_FLAGS;
|
|
||||||
typedef UINT32 PEN_MASK;
|
|
||||||
typedef UINT32 TOUCH_FLAGS;
|
|
||||||
typedef UINT32 TOUCH_MASK;
|
|
||||||
|
|
||||||
typedef enum tagPOINTER_BUTTON_CHANGE_TYPE {
|
|
||||||
POINTER_CHANGE_NONE,
|
POINTER_CHANGE_NONE,
|
||||||
POINTER_CHANGE_FIRSTBUTTON_DOWN,
|
POINTER_CHANGE_FIRSTBUTTON_DOWN,
|
||||||
POINTER_CHANGE_FIRSTBUTTON_UP,
|
POINTER_CHANGE_FIRSTBUTTON_UP,
|
||||||
@ -136,11 +129,12 @@ typedef enum tagPOINTER_BUTTON_CHANGE_TYPE {
|
|||||||
POINTER_CHANGE_FIFTHBUTTON_UP,
|
POINTER_CHANGE_FIFTHBUTTON_UP,
|
||||||
} POINTER_BUTTON_CHANGE_TYPE;
|
} POINTER_BUTTON_CHANGE_TYPE;
|
||||||
|
|
||||||
typedef struct tagPOINTER_INFO {
|
typedef struct
|
||||||
POINTER_INPUT_TYPE pointerType;
|
{
|
||||||
|
DWORD pointerType;
|
||||||
UINT32 pointerId;
|
UINT32 pointerId;
|
||||||
UINT32 frameId;
|
UINT32 frameId;
|
||||||
POINTER_FLAGS pointerFlags;
|
UINT32 pointerFlags;
|
||||||
HANDLE sourceDevice;
|
HANDLE sourceDevice;
|
||||||
HWND hwndTarget;
|
HWND hwndTarget;
|
||||||
POINT ptPixelLocation;
|
POINT ptPixelLocation;
|
||||||
@ -155,47 +149,41 @@ typedef struct tagPOINTER_INFO {
|
|||||||
POINTER_BUTTON_CHANGE_TYPE ButtonChangeType;
|
POINTER_BUTTON_CHANGE_TYPE ButtonChangeType;
|
||||||
} POINTER_INFO;
|
} POINTER_INFO;
|
||||||
|
|
||||||
typedef struct tagPOINTER_PEN_INFO {
|
typedef struct
|
||||||
|
{
|
||||||
POINTER_INFO pointerInfo;
|
POINTER_INFO pointerInfo;
|
||||||
PEN_FLAGS penFlags;
|
UINT32 penFlags;
|
||||||
PEN_MASK penMask;
|
UINT32 penMask;
|
||||||
UINT32 pressure;
|
UINT32 pressure;
|
||||||
UINT32 rotation;
|
UINT32 rotation;
|
||||||
INT32 tiltX;
|
INT32 tiltX;
|
||||||
INT32 tiltY;
|
INT32 tiltY;
|
||||||
} POINTER_PEN_INFO;
|
} POINTER_PEN_INFO;
|
||||||
|
|
||||||
typedef struct tagPOINTER_TOUCH_INFO {
|
typedef struct
|
||||||
|
{
|
||||||
POINTER_INFO pointerInfo;
|
POINTER_INFO pointerInfo;
|
||||||
TOUCH_FLAGS touchFlags;
|
UINT32 touchFlags;
|
||||||
TOUCH_MASK touchMask;
|
UINT32 touchMask;
|
||||||
RECT rcContact;
|
RECT rcContact;
|
||||||
RECT rcContactRaw;
|
RECT rcContactRaw;
|
||||||
UINT32 orientation;
|
UINT32 orientation;
|
||||||
UINT32 pressure;
|
UINT32 pressure;
|
||||||
} POINTER_TOUCH_INFO;
|
} POINTER_TOUCH_INFO;
|
||||||
|
|
||||||
enum tagPOINTER_INPUT_TYPE {
|
enum {
|
||||||
PT_POINTER = 0x00000001, // Generic pointer
|
PT_POINTER = 0x00000001, // Generic pointer
|
||||||
PT_TOUCH = 0x00000002, // Touch
|
PT_TOUCH = 0x00000002, // Touch
|
||||||
PT_PEN = 0x00000003, // Pen
|
PT_PEN = 0x00000003, // Pen
|
||||||
PT_MOUSE = 0x00000004, // Mouse
|
PT_MOUSE = 0x00000004, // Mouse
|
||||||
#if(WINVER >= 0x0603)
|
#if WINVER >= 0x0603
|
||||||
PT_TOUCHPAD = 0x00000005, // Touchpad
|
PT_TOUCHPAD = 0x00000005, // Touchpad
|
||||||
#endif /* WINVER >= 0x0603 */
|
#endif /* WINVER >= 0x0603 */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct tagPOINTER_TYPE_INFO {
|
WINUSERAPI BOOL WINAPI GetPointerType(UINT32,DWORD*);
|
||||||
POINTER_INPUT_TYPE type;
|
WINUSERAPI BOOL WINAPI GetPointerPenInfo(UINT32,POINTER_PEN_INFO*);
|
||||||
union {
|
WINUSERAPI BOOL WINAPI GetPointerInfo(UINT32,POINTER_INFO*);
|
||||||
POINTER_TOUCH_INFO touchInfo;
|
|
||||||
POINTER_PEN_INFO penInfo;
|
|
||||||
} DUMMYUNIONNAME;
|
|
||||||
} POINTER_TYPE_INFO, *PPOINTER_TYPE_INFO;
|
|
||||||
|
|
||||||
WINUSERAPI BOOL WINAPI GetPointerType(_In_ UINT32 pointerId, _Out_ POINTER_INPUT_TYPE *pointerType);
|
|
||||||
WINUSERAPI BOOL WINAPI GetPointerPenInfo(_In_ UINT32 pointerId, _Out_writes_(1) POINTER_PEN_INFO *penInfo);
|
|
||||||
WINUSERAPI BOOL WINAPI GetPointerInfo(_In_ UINT32 pointerId, _Out_writes_(1) POINTER_INFO *pointerInfo);
|
|
||||||
|
|
||||||
#endif /*Windows 8 and above*/
|
#endif /*Windows 8 and above*/
|
||||||
|
|
||||||
|
@ -570,7 +570,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
POINTER_PEN_INFO penInfo;
|
POINTER_PEN_INFO penInfo;
|
||||||
POINTER_INFO pointerInfo;
|
POINTER_INFO pointerInfo;
|
||||||
UINT32 pointerId = GET_POINTERID_WPARAM(wParam);
|
UINT32 pointerId = GET_POINTERID_WPARAM(wParam);
|
||||||
POINTER_INPUT_TYPE pointerType = PT_POINTER;
|
DWORD pointerType = PT_POINTER;
|
||||||
|
|
||||||
// default to unhandled to enable call to DefWindowProc
|
// default to unhandled to enable call to DefWindowProc
|
||||||
BOOL fHandled = FALSE;
|
BOOL fHandled = FALSE;
|
||||||
@ -619,7 +619,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// success, proceed with pointerInfo.
|
// success, proceed with pointerInfo.
|
||||||
// fHandled = HandleGenericPointerMessage(&pointerInfo);
|
// fHandled = HandleGenericPointerMessage(&pointerInfo);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1064,7 +1064,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
|
|
||||||
case WM_DROPFILES:
|
case WM_DROPFILES:
|
||||||
{
|
{
|
||||||
HDROP drop = (HDROP) wParam;
|
HDROP drop = (HDROP)wParam;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1095,9 +1095,9 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
|
|||||||
DragFinish(drop);
|
DragFinish(drop);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
|
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates the GLFW window
|
// Creates the GLFW window
|
||||||
@ -1666,7 +1666,7 @@ void _glfwPlatformSetWindowOpacity(_GLFWwindow* window, float opacity)
|
|||||||
{
|
{
|
||||||
if (opacity < 1.f)
|
if (opacity < 1.f)
|
||||||
{
|
{
|
||||||
const BYTE alpha = (BYTE) (255 * opacity);
|
const BYTE alpha = (BYTE)(255 * opacity);
|
||||||
DWORD style = GetWindowLongW(window->win32.handle, GWL_EXSTYLE);
|
DWORD style = GetWindowLongW(window->win32.handle, GWL_EXSTYLE);
|
||||||
style |= WS_EX_LAYERED;
|
style |= WS_EX_LAYERED;
|
||||||
SetWindowLongW(window->win32.handle, GWL_EXSTYLE, style);
|
SetWindowLongW(window->win32.handle, GWL_EXSTYLE, style);
|
||||||
|
Loading…
Reference in New Issue
Block a user