mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
884237d0c6 | ||
|
7548690c51 | ||
|
a726a88f70 | ||
|
79a7fee0a7 | ||
|
f70344aac0 | ||
|
8f4ac13919 | ||
|
bd2e27978e | ||
|
a58b73aeb4 |
@@ -17,6 +17,12 @@ Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
|
||||
Distributed under the LGPLv2 license (See MacRomanConversion/LICENSE.txt)
|
||||
|
||||
|
||||
RapidJSON:
|
||||
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
|
||||
|
||||
Distributed under the MIT license (See rapidjson/license.txt)
|
||||
|
||||
|
||||
zlib:
|
||||
(C) 1995-2017 Jean-loup Gailly and Mark Adler
|
||||
Distributed under zlib license (See zlib/README)
|
78
Aerofoil.sln
78
Aerofoil.sln
@@ -44,163 +44,85 @@ EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Debug|x64.Build.0 = Debug|x64
|
||||
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Debug|x86.Build.0 = Debug|Win32
|
||||
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x64.ActiveCfg = Release|x64
|
||||
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x64.Build.0 = Release|x64
|
||||
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x86.ActiveCfg = Release|Win32
|
||||
{45B1B18C-C846-4044-9206-74F58DFC5E88}.Release|x86.Build.0 = Release|Win32
|
||||
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Debug|x64.Build.0 = Debug|x64
|
||||
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Debug|x86.Build.0 = Debug|Win32
|
||||
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x64.ActiveCfg = Release|x64
|
||||
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x64.Build.0 = Release|x64
|
||||
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6EC62B0F-9353-40A4-A510-3788F1368B33}.Release|x86.Build.0 = Release|Win32
|
||||
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Debug|x64.Build.0 = Debug|x64
|
||||
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Debug|x86.Build.0 = Debug|Win32
|
||||
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x64.ActiveCfg = Release|x64
|
||||
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x64.Build.0 = Release|x64
|
||||
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x86.ActiveCfg = Release|Win32
|
||||
{2FF15659-5C72-48B8-B55B-3C658E4125B5}.Release|x86.Build.0 = Release|Win32
|
||||
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Debug|x64.Build.0 = Debug|x64
|
||||
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Debug|x86.Build.0 = Debug|Win32
|
||||
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x64.ActiveCfg = Release|x64
|
||||
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x64.Build.0 = Release|x64
|
||||
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6233C3F2-5781-488E-B190-4FA8836F5A77}.Release|x86.Build.0 = Release|Win32
|
||||
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Debug|x64.Build.0 = Debug|x64
|
||||
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Debug|x86.Build.0 = Debug|Win32
|
||||
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x64.ActiveCfg = Release|x64
|
||||
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x64.Build.0 = Release|x64
|
||||
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x86.ActiveCfg = Release|Win32
|
||||
{5FDE4822-C771-46A5-B6B2-FD12BACE86BF}.Release|x86.Build.0 = Release|Win32
|
||||
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Debug|x64.Build.0 = Debug|x64
|
||||
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Debug|x86.Build.0 = Debug|Win32
|
||||
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x64.ActiveCfg = Release|x64
|
||||
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x64.Build.0 = Release|x64
|
||||
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x86.ActiveCfg = Release|Win32
|
||||
{99549E56-2B3A-4B0C-9A1F-FBA6395BC96C}.Release|x86.Build.0 = Release|Win32
|
||||
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Debug|x64.Build.0 = Debug|x64
|
||||
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Debug|x86.Build.0 = Debug|Win32
|
||||
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x64.ActiveCfg = Release|x64
|
||||
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x64.Build.0 = Release|x64
|
||||
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x86.ActiveCfg = Release|Win32
|
||||
{E3BDC783-8646-433E-ADF0-8B6390D36669}.Release|x86.Build.0 = Release|Win32
|
||||
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Debug|x64.Build.0 = Debug|x64
|
||||
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Debug|x86.Build.0 = Debug|Win32
|
||||
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x64.ActiveCfg = Release|x64
|
||||
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x64.Build.0 = Release|x64
|
||||
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x86.ActiveCfg = Release|Win32
|
||||
{A8FCDC5E-729C-4A80-BF9F-B669C52B2AE3}.Release|x86.Build.0 = Release|Win32
|
||||
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Debug|x64.Build.0 = Debug|x64
|
||||
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Debug|x86.Build.0 = Debug|Win32
|
||||
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x64.ActiveCfg = Release|x64
|
||||
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x64.Build.0 = Release|x64
|
||||
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x86.ActiveCfg = Release|Win32
|
||||
{487216D8-16BA-4B4C-B5BF-43FEEDFEE03A}.Release|x86.Build.0 = Release|Win32
|
||||
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Debug|x64.Build.0 = Debug|x64
|
||||
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Debug|x86.Build.0 = Debug|Win32
|
||||
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x64.ActiveCfg = Release|x64
|
||||
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x64.Build.0 = Release|x64
|
||||
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x86.ActiveCfg = Release|Win32
|
||||
{ED2F91E1-673A-4590-82B2-EB157927D3E3}.Release|x86.Build.0 = Release|Win32
|
||||
{B852D549-4020-4477-8BFB-E199FF78B047}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B852D549-4020-4477-8BFB-E199FF78B047}.Debug|x64.Build.0 = Debug|x64
|
||||
{B852D549-4020-4477-8BFB-E199FF78B047}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{B852D549-4020-4477-8BFB-E199FF78B047}.Debug|x86.Build.0 = Debug|Win32
|
||||
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x64.ActiveCfg = Release|x64
|
||||
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x64.Build.0 = Release|x64
|
||||
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B852D549-4020-4477-8BFB-E199FF78B047}.Release|x86.Build.0 = Release|Win32
|
||||
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Debug|x64.Build.0 = Debug|x64
|
||||
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Debug|x86.Build.0 = Debug|Win32
|
||||
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x64.ActiveCfg = Release|x64
|
||||
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x64.Build.0 = Release|x64
|
||||
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x86.ActiveCfg = Release|Win32
|
||||
{FFC961AC-55B4-4A38-A83E-06AE98F59ACC}.Release|x86.Build.0 = Release|Win32
|
||||
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Debug|x64.Build.0 = Debug|x64
|
||||
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Debug|x86.Build.0 = Debug|Win32
|
||||
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x64.ActiveCfg = Release|x64
|
||||
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x64.Build.0 = Release|x64
|
||||
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x86.ActiveCfg = Release|Win32
|
||||
{17B96F07-EF92-47CD-95A5-8E6EE38AB564}.Release|x86.Build.0 = Release|Win32
|
||||
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Debug|x64.Build.0 = Debug|x64
|
||||
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Debug|x86.Build.0 = Debug|Win32
|
||||
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x64.ActiveCfg = Release|x64
|
||||
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x64.Build.0 = Release|x64
|
||||
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x86.ActiveCfg = Release|Win32
|
||||
{0E383EF0-CEF7-4733-87C6-5AC9844AA1EF}.Release|x86.Build.0 = Release|Win32
|
||||
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Debug|x64.Build.0 = Debug|x64
|
||||
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Debug|x86.Build.0 = Debug|Win32
|
||||
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x64.ActiveCfg = Release|x64
|
||||
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x64.Build.0 = Release|x64
|
||||
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x86.ActiveCfg = Release|Win32
|
||||
{07351A8E-1F79-42C9-BBAB-31F071EAA99E}.Release|x86.Build.0 = Release|Win32
|
||||
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Debug|x64.Build.0 = Debug|x64
|
||||
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Debug|x86.Build.0 = Debug|Win32
|
||||
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x64.ActiveCfg = Release|x64
|
||||
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x64.Build.0 = Release|x64
|
||||
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x86.ActiveCfg = Release|Win32
|
||||
{27B7CA46-ED23-45C2-BF5F-0C126D81AEBF}.Release|x86.Build.0 = Release|Win32
|
||||
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Debug|x64.Build.0 = Debug|x64
|
||||
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Debug|x86.Build.0 = Debug|Win32
|
||||
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x64.ActiveCfg = Release|x64
|
||||
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x64.Build.0 = Release|x64
|
||||
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6AE5C85E-6631-4A12-97A0-A05F812FE9CA}.Release|x86.Build.0 = Release|Win32
|
||||
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Debug|x64.Build.0 = Debug|x64
|
||||
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x64.ActiveCfg = Release|x64
|
||||
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x64.Build.0 = Release|x64
|
||||
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{D7BFE702-0667-4155-9B0B-2A54DF9AE60B}.Release|x86.Build.0 = Release|Win32
|
||||
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Debug|x64.Build.0 = Debug|x64
|
||||
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x64.ActiveCfg = Release|x64
|
||||
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x64.Build.0 = Release|x64
|
||||
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{9023DF2F-A33D-485A-B13D-0973348B2F9B}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@@ -32,10 +32,14 @@ IGpFiber *GpFiberStarter::StartFiber(ThreadFunc_t threadFunc, void *context, IGp
|
||||
{
|
||||
ULONG_PTR lowLimit;
|
||||
ULONG_PTR highLimit;
|
||||
|
||||
|
||||
#if 0
|
||||
GetCurrentThreadStackLimits(&lowLimit, &highLimit);
|
||||
|
||||
ULONG_PTR stackSize = highLimit - lowLimit;
|
||||
ULONG_PTR stackSize = highLimit - lowLimit;
|
||||
#else
|
||||
ULONG_PTR stackSize = 1024 * 1024;
|
||||
#endif
|
||||
|
||||
GpFiberStarter_Win32::FiberStartState startState;
|
||||
startState.m_context = context;
|
||||
|
@@ -341,7 +341,7 @@ static void TranslateWindowsMessage(const MSG *msg, IGpVOSEventQueue *eventQueue
|
||||
GpKeyboardInputEvent::KeyUnion key;
|
||||
bool isRepeat = ((lParam & 0x40000000) != 0);
|
||||
const GpKeyboardInputEventType_t keyEventType = isRepeat ? GpKeyboardInputEventTypes::kAuto : GpKeyboardInputEventTypes::kDown;
|
||||
if (!isRepeat && IdentifyVKey(wParam, lParam, subset, key))
|
||||
if (IdentifyVKey(wParam, lParam, subset, key))
|
||||
PostKeyboardEvent(eventQueue, keyEventType, subset, key, static_cast<uint32_t>(lParam & 0xffff));
|
||||
|
||||
(void)TranslateMessage(msg);
|
||||
@@ -357,21 +357,20 @@ static void TranslateWindowsMessage(const MSG *msg, IGpVOSEventQueue *eventQueue
|
||||
}
|
||||
break;
|
||||
case WM_CHAR:
|
||||
{
|
||||
bool isRepeat = ((lParam & 0x4000000) != 0);
|
||||
const GpKeyboardInputEventType_t keyEventType = isRepeat ? GpKeyboardInputEventTypes::kAutoChar : GpKeyboardInputEventTypes::kDownChar;
|
||||
GpKeyboardInputEvent::KeyUnion key;
|
||||
key.m_asciiChar = static_cast<char>(wParam);
|
||||
PostKeyboardEvent(eventQueue, keyEventType, GpKeyIDSubsets::kASCII, key, (lParam & 0xffff));
|
||||
}
|
||||
break;
|
||||
case WM_UNICHAR:
|
||||
{
|
||||
bool isRepeat = ((lParam & 0x4000000) != 0);
|
||||
const GpKeyboardInputEventType_t keyEventType = isRepeat ? GpKeyboardInputEventTypes::kAutoChar : GpKeyboardInputEventTypes::kDownChar;
|
||||
GpKeyboardInputEvent::KeyUnion key;
|
||||
key.m_unicodeChar = static_cast<uint32_t>(wParam);
|
||||
PostKeyboardEvent(eventQueue, keyEventType, GpKeyIDSubsets::kUnicode, key, (lParam & 0xffff));
|
||||
GpKeyIDSubset_t subset = GpKeyIDSubsets::kASCII;
|
||||
if (wParam <= 128)
|
||||
key.m_asciiChar = static_cast<char>(wParam);
|
||||
else
|
||||
{
|
||||
subset = GpKeyIDSubsets::kUnicode;
|
||||
key.m_unicodeChar = static_cast<uint32_t>(wParam);
|
||||
}
|
||||
PostKeyboardEvent(eventQueue, keyEventType, subset, key, (lParam & 0xffff));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
202
Documentation/license_apache.txt
Normal file
202
Documentation/license_apache.txt
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
339
Documentation/license_gplv2.txt
Normal file
339
Documentation/license_gplv2.txt
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
165
Documentation/license_lgplv2.txt
Normal file
165
Documentation/license_lgplv2.txt
Normal file
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
57
Documentation/license_rapidjson.txt
Normal file
57
Documentation/license_rapidjson.txt
Normal file
@@ -0,0 +1,57 @@
|
||||
Tencent is pleased to support the open source community by making RapidJSON available.
|
||||
|
||||
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
|
||||
|
||||
If you have downloaded a copy of the RapidJSON binary from Tencent, please note that the RapidJSON binary is licensed under the MIT License.
|
||||
If you have downloaded a copy of the RapidJSON source code from Tencent, please note that RapidJSON source code is licensed under the MIT License, except for the third-party components listed below which are subject to different license terms. Your integration of RapidJSON into your own projects may require compliance with the MIT License, as well as the other licenses applicable to the third-party components included within RapidJSON. To avoid the problematic JSON license in your own projects, it's sufficient to exclude the bin/jsonchecker/ directory, as it's the only code under the JSON license.
|
||||
A copy of the MIT License is included in this file.
|
||||
|
||||
Other dependencies and licenses:
|
||||
|
||||
Open Source Software Licensed Under the BSD License:
|
||||
--------------------------------------------------------------------
|
||||
|
||||
The msinttypes r29
|
||||
Copyright (c) 2006-2013 Alexander Chemeris
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Open Source Software Licensed Under the JSON License:
|
||||
--------------------------------------------------------------------
|
||||
|
||||
json.org
|
||||
Copyright (c) 2002 JSON.org
|
||||
All Rights Reserved.
|
||||
|
||||
JSON_checker
|
||||
Copyright (c) 2002 JSON.org
|
||||
All Rights Reserved.
|
||||
|
||||
|
||||
Terms of the JSON License:
|
||||
---------------------------------------------------
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
The Software shall be used for Good, not Evil.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Terms of the MIT License:
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
70
Documentation/readme.txt
Normal file
70
Documentation/readme.txt
Normal file
@@ -0,0 +1,70 @@
|
||||
Aerofoil is a third-party port of Glider PRO
|
||||
|
||||
Glider PRO is (c)1994-2000 Casady & Greene, Inc., written by John Calhoun
|
||||
Aerofoil is (c)2019-2020 Eric Lasota
|
||||
|
||||
Requires Windows 8 and the Visual Studio 2017 redistributable runtime.
|
||||
Please see this page for more info:
|
||||
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
|
||||
|
||||
XInput gamepads are supported. Other gamepads may be supported via third-party software that maps them to XInput (i.e. PS4 gamepads are supported via DS4Windows)
|
||||
|
||||
Some shortcuts:
|
||||
- While in-game, Ctrl-S saves the game. You can then reload the game from the main menu.
|
||||
- Ctrl-Q quits the game.
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Roboto font:
|
||||
(c)2011 Google
|
||||
Distributed under the Apache License (see license_apache.txt)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Open Sans font:
|
||||
(c)2011 Google
|
||||
Distributed under the Apache License (see license_apache.txt)
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
stb_image_write:
|
||||
Created by Sean Barrett
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
LIBICONV:
|
||||
Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
|
||||
|
||||
Distributed under the LGPLv2 license (See license_lgplv2.txt)
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
RapidJSON:
|
||||
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
|
||||
|
||||
Distributed under the MIT license (See license_rapidjson.txt)
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
zlib:
|
||||
|
||||
(C) 1995-2017 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
@@ -27,7 +27,7 @@
|
||||
static void HiLiteOkayButton (DrawSurface *surface);
|
||||
static void UnHiLiteOkayButton (DrawSurface *surface);
|
||||
static void UpdateMainPict (Dialog *);
|
||||
static int16_t AboutFilter(Dialog *, const TimeTaggedVOSEvent &evt);
|
||||
static int16_t AboutFilter(Dialog *, const TimeTaggedVOSEvent *evt);
|
||||
|
||||
|
||||
static Point okayButtLowerV, okayButtUpperV;
|
||||
@@ -176,17 +176,20 @@ static bool PointIsInDiagonalOkayButton(const Point &pt)
|
||||
//-------------------------------------------------------------- AboutFilter
|
||||
// Dialog filter for the About dialog.
|
||||
|
||||
static int16_t AboutFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt)
|
||||
static int16_t AboutFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
bool handledIt = false;
|
||||
int16_t hit = -1;
|
||||
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
Window *window = dialog->GetWindow();
|
||||
DrawSurface *surface = window->GetDrawSurface();
|
||||
|
||||
if (evt.IsKeyDownEvent())
|
||||
if (evt->IsKeyDownEvent())
|
||||
{
|
||||
switch (PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent))
|
||||
switch (PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent))
|
||||
{
|
||||
case PL_KEY_SPECIAL(kEnter):
|
||||
case PL_KEY_NUMPAD_SPECIAL(kEnter):
|
||||
@@ -202,9 +205,9 @@ static int16_t AboutFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (evt.m_vosEvent.m_eventType == GpVOSEventTypes::kMouseInput)
|
||||
else if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kMouseInput)
|
||||
{
|
||||
const GpMouseInputEvent &mouseEvt = evt.m_vosEvent.m_event.m_mouseInputEvent;
|
||||
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
|
||||
const Point mousePt = window->MouseToLocal(mouseEvt);
|
||||
|
||||
if (mouseEvt.m_eventType == GpMouseEventTypes::kDown)
|
||||
|
@@ -169,7 +169,7 @@ void HandleKeyEvent (const KeyDownStates &keyStates, const GpKeyboardInputEvent
|
||||
const bool optionDown = keyStates.IsSet(PL_KEY_EITHER_SPECIAL(kAlt));
|
||||
|
||||
if ((commandDown) && (!optionDown))
|
||||
DoMenuChoice(MenuKey(static_cast<int>(theChar)));
|
||||
DoMenuChoice(MenuKey(theChar));
|
||||
else
|
||||
{
|
||||
switch (theChar)
|
||||
|
@@ -83,6 +83,7 @@
|
||||
<Import Project="GpApp.props" />
|
||||
<Import Project="..\Common.props" />
|
||||
<Import Project="..\GpCommon.props" />
|
||||
<Import Project="..\Release.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
@@ -43,10 +43,10 @@ namespace PortabilityLayer
|
||||
|
||||
void DrawHighScores (DrawSurface *);
|
||||
void UpdateNameDialog (Dialog *);
|
||||
Boolean NameFilter (Dialog *, EventRecord *, short *);
|
||||
int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent *evt);
|
||||
void GetHighScoreName (short);
|
||||
void UpdateBannerDialog (Dialog *);
|
||||
int16_t BannerFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt);
|
||||
int16_t BannerFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt);
|
||||
void GetHighScoreBanner (void);
|
||||
Boolean OpenHighScoresFile (const VFileSpec &spec, PortabilityLayer::IOStream *&outStream);
|
||||
|
||||
@@ -397,6 +397,9 @@ Boolean TestHighScore (void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsHighScoreForceTop())
|
||||
placing = 0;
|
||||
|
||||
if (placing != -1)
|
||||
{
|
||||
@@ -446,7 +449,7 @@ void UpdateNameDialog (Dialog *theDialog)
|
||||
//-------------------------------------------------------------- NameFilter
|
||||
// Dialog filter for the "Enter High Score Name" dialog.
|
||||
|
||||
int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
short nChars;
|
||||
|
||||
@@ -457,13 +460,17 @@ int16_t NameFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
keyStroke = false;
|
||||
}
|
||||
|
||||
if (evt.m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
|
||||
{
|
||||
const GpKeyboardInputEvent &kbEvent = evt.m_vosEvent.m_event.m_keyboardInputEvent;
|
||||
const GpKeyboardInputEvent &kbEvent = evt->m_vosEvent.m_event.m_keyboardInputEvent;
|
||||
|
||||
if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar || kbEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar)
|
||||
{
|
||||
PlayPrioritySound(kTypingSound, kTypingPriority);
|
||||
keyStroke = true;
|
||||
return -1; // Don't capture, need this to forward to the editbox
|
||||
}
|
||||
else if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDown)
|
||||
@@ -544,7 +551,7 @@ void UpdateBannerDialog (Dialog *theDialog)
|
||||
//-------------------------------------------------------------- BannerFilter
|
||||
// Dialog filter for the "Enter Message" dialog.
|
||||
|
||||
int16_t BannerFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
int16_t BannerFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
short nChars;
|
||||
|
||||
@@ -555,13 +562,17 @@ int16_t BannerFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
keyStroke = false;
|
||||
}
|
||||
|
||||
if (evt.m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
|
||||
{
|
||||
const GpKeyboardInputEvent &kbEvent = evt.m_vosEvent.m_event.m_keyboardInputEvent;
|
||||
const GpKeyboardInputEvent &kbEvent = evt->m_vosEvent.m_event.m_keyboardInputEvent;
|
||||
|
||||
if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar || kbEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar)
|
||||
{
|
||||
PlayPrioritySound(kTypingSound, kTypingPriority);
|
||||
keyStroke = true;
|
||||
return -1; // Don't capture, need this to forward to the editbox
|
||||
}
|
||||
else if (kbEvent.m_eventType == GpKeyboardInputEventTypes::kDown)
|
||||
|
@@ -44,7 +44,7 @@
|
||||
void UpdateLoadDialog (Dialog *);
|
||||
void PageUpHouses (Dialog *);
|
||||
void PageDownHouses (Dialog *);
|
||||
int16_t LoadFilter (Dialog *, const TimeTaggedVOSEvent &);
|
||||
int16_t LoadFilter (Dialog *, const TimeTaggedVOSEvent *);
|
||||
void SortHouseList (void);
|
||||
void DoDirSearch (void);
|
||||
|
||||
@@ -201,13 +201,16 @@ void PageDownHouses (Dialog *theDial)
|
||||
//-------------------------------------------------------------- LoadFilter
|
||||
#ifndef COMPILEDEMO
|
||||
|
||||
int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
short screenCount, i, wasIndex;
|
||||
|
||||
if (evt.IsKeyDownEvent())
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
if (evt->IsKeyDownEvent())
|
||||
{
|
||||
const intptr_t keyCode = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
const intptr_t keyCode = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
switch (keyCode)
|
||||
{
|
||||
case PL_KEY_SPECIAL(kEnter):
|
||||
@@ -316,20 +319,20 @@ int16_t LoadFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (evt.IsLMouseDownEvent())
|
||||
else if (evt->IsLMouseDownEvent())
|
||||
{
|
||||
const GpMouseInputEvent &mouseEvt = evt.m_vosEvent.m_event.m_mouseInputEvent;
|
||||
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
|
||||
|
||||
lastWhenClick = evt.m_timestamp - lastWhenClick;
|
||||
lastWhenClick = evt->m_timestamp - lastWhenClick;
|
||||
lastWhereClick -= Point::Create(mouseEvt.m_x, mouseEvt.m_y);
|
||||
|
||||
return -1;
|
||||
}
|
||||
else if (evt.IsLMouseUpEvent())
|
||||
else if (evt->IsLMouseUpEvent())
|
||||
{
|
||||
const GpMouseInputEvent &mouseEvt = evt.m_vosEvent.m_event.m_mouseInputEvent;
|
||||
const GpMouseInputEvent &mouseEvt = evt->m_vosEvent.m_event.m_mouseInputEvent;
|
||||
|
||||
lastWhenClick = evt.m_timestamp;
|
||||
lastWhenClick = evt->m_timestamp;
|
||||
lastWhereClick = Point::Create(mouseEvt.m_x, mouseEvt.m_y);
|
||||
|
||||
return -1;
|
||||
|
@@ -64,27 +64,27 @@
|
||||
|
||||
void SetBrainsToDefaults (Dialog *);
|
||||
void UpdateSettingsBrains (Dialog *);
|
||||
int16_t BrainsFilter (Dialog *, const TimeTaggedVOSEvent &);
|
||||
int16_t BrainsFilter (Dialog *, const TimeTaggedVOSEvent *);
|
||||
void DoBrainsPrefs (void);
|
||||
void SetControlsToDefaults (Dialog *);
|
||||
void UpdateControlKeyName (Dialog *);
|
||||
void UpdateSettingsControl (Dialog *);
|
||||
int16_t ControlFilter (Dialog *, const TimeTaggedVOSEvent &);
|
||||
int16_t ControlFilter (Dialog *, const TimeTaggedVOSEvent *);
|
||||
void DoControlPrefs (void);
|
||||
void SoundDefaults (Dialog *);
|
||||
void UpdateSettingsSound (Dialog *);
|
||||
void HandleSoundMusicChange (short, Boolean);
|
||||
int16_t SoundFilter(Dialog *, const TimeTaggedVOSEvent &);
|
||||
int16_t SoundFilter(Dialog *, const TimeTaggedVOSEvent *);
|
||||
void DoSoundPrefs (void);
|
||||
void DisplayDefaults (void);
|
||||
void FrameDisplayIcon (Dialog *, const PortabilityLayer::RGBAColor &color);
|
||||
void DisplayUpdate (Dialog *);
|
||||
int16_t DisplayFilter(Dialog *dialog, const TimeTaggedVOSEvent &);
|
||||
int16_t DisplayFilter(Dialog *dialog, const TimeTaggedVOSEvent *);
|
||||
void DoDisplayPrefs (void);
|
||||
void SetAllDefaults (void);
|
||||
void FlashSettingsButton (DrawSurface *, short);
|
||||
void UpdateSettingsMain (Dialog *);
|
||||
int16_t PrefsFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt);
|
||||
int16_t PrefsFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt);
|
||||
void BitchAboutChanges (void);
|
||||
|
||||
|
||||
@@ -145,11 +145,14 @@ void UpdateSettingsBrains (Dialog *theDialog)
|
||||
|
||||
//-------------------------------------------------------------- BrainsFilter
|
||||
|
||||
int16_t BrainsFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
int16_t BrainsFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
if (evt.IsKeyDownEvent())
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
if (evt->IsKeyDownEvent())
|
||||
{
|
||||
intptr_t keyCode = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
intptr_t keyCode = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
|
||||
switch (keyCode)
|
||||
{
|
||||
@@ -186,6 +189,19 @@ int16_t BrainsFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
}
|
||||
}
|
||||
|
||||
if (evt->m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
|
||||
{
|
||||
const GpKeyboardInputEvent &keyEvent = evt->m_vosEvent.m_event.m_keyboardInputEvent;
|
||||
if (keyEvent.m_keyIDSubset == GpKeyIDSubsets::kUnicode)
|
||||
return 0;
|
||||
if (keyEvent.m_keyIDSubset == GpKeyIDSubsets::kASCII)
|
||||
{
|
||||
char asciiChar = (keyEvent.m_key.m_asciiChar);
|
||||
if (asciiChar < '0' || asciiChar > '9')
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -220,6 +236,8 @@ void DoBrainsPrefs (void)
|
||||
|
||||
UpdateSettingsBrains(prefDlg);
|
||||
|
||||
prefDlg->GetWindow()->FocusWidget(prefDlg->GetItems()[kMaxFilesItem - 1].GetWidget());
|
||||
|
||||
while (!leaving)
|
||||
{
|
||||
itemHit = prefDlg->ExecuteModal(BrainsFilter);
|
||||
@@ -353,18 +371,21 @@ void UpdateSettingsControl (Dialog *theDialog)
|
||||
|
||||
//-------------------------------------------------------------- ControlFilter
|
||||
|
||||
int16_t ControlFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
int16_t ControlFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
intptr_t wasKeyMap;
|
||||
|
||||
if (evt.IsKeyDownEvent())
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
if (evt->IsKeyDownEvent())
|
||||
{
|
||||
GpKeyIDSubset_t subset = evt.m_vosEvent.m_event.m_keyboardInputEvent.m_keyIDSubset;
|
||||
GpKeyIDSubset_t subset = evt->m_vosEvent.m_event.m_keyboardInputEvent.m_keyIDSubset;
|
||||
|
||||
// Ignore Unicode (for now) and gamepad buttons
|
||||
if (subset == GpKeyIDSubsets::kASCII || subset == GpKeyIDSubsets::kSpecial || subset == GpKeyIDSubsets::kNumPadNumber || subset == GpKeyIDSubsets::kNumPadSpecial || subset == GpKeyIDSubsets::kFKey)
|
||||
{
|
||||
wasKeyMap = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
wasKeyMap = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
|
||||
switch (whichCtrl)
|
||||
{
|
||||
@@ -626,13 +647,16 @@ void HandleSoundMusicChange (short newVolume, Boolean sayIt)
|
||||
|
||||
//-------------------------------------------------------------- SoundFilter
|
||||
|
||||
int16_t SoundFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
int16_t SoundFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
short newVolume;
|
||||
|
||||
if (evt.IsKeyDownEvent())
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
if (evt->IsKeyDownEvent())
|
||||
{
|
||||
intptr_t keyCode = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
intptr_t keyCode = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
|
||||
switch (keyCode)
|
||||
{
|
||||
@@ -885,11 +909,14 @@ void DisplayUpdate (Dialog *theDialog)
|
||||
|
||||
//-------------------------------------------------------------- DisplayFilter
|
||||
|
||||
int16_t DisplayFilter(Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
int16_t DisplayFilter(Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
if (evt.IsKeyDownEvent())
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
if (evt->IsKeyDownEvent())
|
||||
{
|
||||
switch (PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent))
|
||||
switch (PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent))
|
||||
{
|
||||
case PL_KEY_SPECIAL(kEnter):
|
||||
case PL_KEY_NUMPAD_SPECIAL(kEnter):
|
||||
@@ -1194,14 +1221,17 @@ void UpdateSettingsMain (Dialog *theDialog)
|
||||
|
||||
//-------------------------------------------------------------- PrefsFilter
|
||||
|
||||
int16_t PrefsFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
int16_t PrefsFilter (Dialog *dial, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
short i;
|
||||
Boolean foundHit;
|
||||
|
||||
if (evt.IsKeyDownEvent())
|
||||
if (!evt)
|
||||
return -1;
|
||||
|
||||
if (evt->IsKeyDownEvent())
|
||||
{
|
||||
intptr_t packedKey = PackVOSKeyCode(evt.m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
intptr_t packedKey = PackVOSKeyCode(evt->m_vosEvent.m_event.m_keyboardInputEvent);
|
||||
|
||||
switch (packedKey)
|
||||
{
|
||||
@@ -1226,10 +1256,10 @@ int16_t PrefsFilter (Dialog *dial, const TimeTaggedVOSEvent &evt)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if (evt.IsLMouseDownEvent())
|
||||
else if (evt->IsLMouseDownEvent())
|
||||
{
|
||||
const Window *window = dial->GetWindow();
|
||||
const GpMouseInputEvent &mouseEvent = evt.m_vosEvent.m_event.m_mouseInputEvent;
|
||||
const GpMouseInputEvent &mouseEvent = evt->m_vosEvent.m_event.m_mouseInputEvent;
|
||||
|
||||
const Point testPt = Point::Create(mouseEvent.m_x - window->m_wmX, mouseEvent.m_y - window->m_wmY);
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <new>
|
||||
|
||||
#pragma comment(lib, "xinput.lib")
|
||||
#pragma comment(lib, "xinput9_1_0.lib")
|
||||
|
||||
void GpInputDriverXInput::ProcessInput()
|
||||
{
|
||||
@@ -179,5 +179,5 @@ void GpInputDriverXInput::ProcessAxisStateChange(int16_t prevState, int16_t newS
|
||||
|
||||
extern "C" __declspec(dllexport) IGpInputDriver *GpDriver_CreateInputDriver_XInput(const GpInputDriverProperties &properties)
|
||||
{
|
||||
return GpInputDriverXInput::Create(properties);
|
||||
return GpInputDriverXInput::Create(properties);
|
||||
}
|
||||
|
@@ -57,4 +57,25 @@ namespace MacRoman
|
||||
else
|
||||
return mac_roman_2uni[character - 0x80];
|
||||
}
|
||||
|
||||
bool FromUnicode(uint8_t &outChar, uint16_t codePoint)
|
||||
{
|
||||
if (codePoint < 0x80)
|
||||
{
|
||||
outChar = static_cast<uint8_t>(codePoint);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int i = 0; i < 128; i++)
|
||||
{
|
||||
if (mac_roman_2uni[i] == codePoint)
|
||||
{
|
||||
outChar = static_cast<uint8_t>(i + 0x80);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -4,5 +4,6 @@
|
||||
|
||||
namespace MacRoman
|
||||
{
|
||||
uint16_t ToUnicode(uint8_t character);
|
||||
uint16_t ToUnicode(uint8_t character);
|
||||
bool FromUnicode(uint8_t &outChar, uint16_t codePoint);
|
||||
}
|
||||
|
@@ -12,5 +12,6 @@ copy /Y x64\Release\GpApp.dll ReleasePkg\Aerofoil
|
||||
|
||||
xcopy /I /E /Y /K Packaged ReleasePkg\Aerofoil\Packaged
|
||||
xcopy /I /E /Y /K Resources ReleasePkg\Aerofoil\Resources
|
||||
xcopy /I /E /Y /K Documentation ReleasePkg\Aerofoil\Documentation
|
||||
|
||||
pause
|
||||
|
@@ -345,13 +345,19 @@ namespace PortabilityLayer
|
||||
for (;;)
|
||||
{
|
||||
TimeTaggedVOSEvent evt;
|
||||
if (WaitForEvent(&evt, 1))
|
||||
|
||||
const bool haveEvent = WaitForEvent(&evt, 1);
|
||||
|
||||
if (window->IsHandlingTickEvents())
|
||||
window->OnTick();
|
||||
|
||||
const int16_t selection = filterFunc(this, haveEvent ? &evt : nullptr);
|
||||
|
||||
if (selection >= 0)
|
||||
return selection;
|
||||
|
||||
if (haveEvent)
|
||||
{
|
||||
const int16_t selection = filterFunc(this, evt);
|
||||
|
||||
if (selection >= 0)
|
||||
return selection;
|
||||
|
||||
if (capturingWidget != nullptr)
|
||||
{
|
||||
const WidgetHandleState_t state = capturingWidget->ProcessEvent(evt);
|
||||
@@ -571,7 +577,7 @@ namespace PortabilityLayer
|
||||
void PositionWindow(Window *window, const Rect &rect);
|
||||
Dialog *LoadDialogFromTemplate(int16_t templateResID, const Rect &rect, bool visible, bool hasCloseBox, uint32_t referenceConstant, uint16_t positionSpec, Window *behindWindow, const PLPasStr &title, const DialogTextSubstitutions *substitutions);
|
||||
|
||||
static int16_t AlertFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt);
|
||||
static int16_t AlertFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt);
|
||||
|
||||
static DialogManagerImpl ms_instance;
|
||||
};
|
||||
@@ -650,7 +656,7 @@ namespace PortabilityLayer
|
||||
return dialog;
|
||||
}
|
||||
|
||||
int16_t DialogManagerImpl::AlertFilter(Dialog *dialog, const TimeTaggedVOSEvent &evt)
|
||||
int16_t DialogManagerImpl::AlertFilter(Dialog *dialog, const TimeTaggedVOSEvent *evt)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
@@ -132,6 +132,8 @@ namespace PortabilityLayer
|
||||
bool SetItemText(const THandle<Menu> &menu, unsigned int index, const PLPasStr &str) override;
|
||||
|
||||
bool IsPointInMenuBar(const Vec2i &point) const override;
|
||||
|
||||
bool FindMenuShortcut(uint16_t &menuID, uint16_t &itemID, uint8_t shortcutChar) override;
|
||||
void MenuSelect(const Vec2i &initialPoint, int16_t *outMenu, uint16_t *outItem) override;
|
||||
|
||||
void DrawMenuBar() override;
|
||||
@@ -520,6 +522,33 @@ namespace PortabilityLayer
|
||||
return point.m_y >= 0 && static_cast<uint32_t>(point.m_y) < kMenuBarHeight;
|
||||
}
|
||||
|
||||
|
||||
bool MenuManagerImpl::FindMenuShortcut(uint16_t &menuID, uint16_t &itemID, uint8_t shortcutChar)
|
||||
{
|
||||
MenuHandle menuH = m_firstMenu;
|
||||
while (menuH)
|
||||
{
|
||||
Menu *menu = *menuH;
|
||||
|
||||
const MenuItem *items = menu->menuItems;
|
||||
const size_t numItems = menu->numMenuItems;
|
||||
|
||||
for (size_t i = 0; i < numItems; i++)
|
||||
{
|
||||
if (items[i].key == shortcutChar)
|
||||
{
|
||||
menuID = menu->menuID;
|
||||
itemID = static_cast<uint16_t>(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
menuH = menu->nextMenu;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MenuManagerImpl::MenuSelect(const Vec2i &initialPoint, int16_t *outMenu, uint16_t *outItem)
|
||||
{
|
||||
RefreshMenuBarLayout();
|
||||
|
@@ -36,6 +36,7 @@ namespace PortabilityLayer
|
||||
|
||||
virtual bool IsPointInMenuBar(const Vec2i &point) const = 0;
|
||||
|
||||
virtual bool FindMenuShortcut(uint16_t &menuID, uint16_t &itemID, uint8_t shortcutChar) = 0;
|
||||
virtual void MenuSelect(const Vec2i &initialPoint, int16_t *outMenu, uint16_t *outItem) = 0;
|
||||
|
||||
virtual void DrawMenuBar() = 0;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "PLCheckboxWidget.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "FontFamily.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -9,6 +10,7 @@ namespace PortabilityLayer
|
||||
CheckboxWidget::CheckboxWidget(const WidgetBasicState &state)
|
||||
: WidgetSpec<CheckboxWidget>(state)
|
||||
, m_text(state.m_text)
|
||||
, m_haveMouseDown(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -69,4 +71,40 @@ namespace PortabilityLayer
|
||||
if (m_window)
|
||||
DrawControl(&m_window->m_surface);
|
||||
}
|
||||
|
||||
WidgetHandleState_t CheckboxWidget::ProcessEvent(const TimeTaggedVOSEvent &evt)
|
||||
{
|
||||
if (m_haveMouseDown)
|
||||
{
|
||||
if (evt.IsLMouseUpEvent())
|
||||
{
|
||||
m_haveMouseDown = false;
|
||||
|
||||
const Point pt = m_window->MouseToLocal(evt.m_vosEvent.m_event.m_mouseInputEvent);
|
||||
if (m_rect.Contains(pt))
|
||||
return WidgetHandleStates::kActivated;
|
||||
else
|
||||
return WidgetHandleStates::kIgnored;
|
||||
}
|
||||
|
||||
return WidgetHandleStates::kCaptured;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (evt.IsLMouseDownEvent())
|
||||
{
|
||||
const Point pt = m_window->MouseToLocal(evt.m_vosEvent.m_event.m_mouseInputEvent);
|
||||
|
||||
if (m_rect.Contains(pt))
|
||||
{
|
||||
m_haveMouseDown = true;
|
||||
return WidgetHandleStates::kCaptured;
|
||||
}
|
||||
else
|
||||
return WidgetHandleStates::kIgnored;
|
||||
}
|
||||
}
|
||||
|
||||
return WidgetHandleStates::kIgnored;
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,10 @@ namespace PortabilityLayer
|
||||
|
||||
void OnStateChanged() override;
|
||||
|
||||
WidgetHandleState_t ProcessEvent(const TimeTaggedVOSEvent &evt);
|
||||
|
||||
private:
|
||||
PascalStr<255> m_text;
|
||||
bool m_haveMouseDown;
|
||||
};
|
||||
}
|
||||
|
@@ -247,10 +247,19 @@ long MenuSelect(Point point)
|
||||
return (static_cast<int32_t>(menuID) << 16) | (static_cast<int32_t>(menuItem));
|
||||
}
|
||||
|
||||
long MenuKey(int charCode)
|
||||
long MenuKey(intptr_t charCode)
|
||||
{
|
||||
PL_NotYetImplemented();
|
||||
return PLErrors::kNone;
|
||||
if (PL_KEY_GET_EVENT_TYPE(charCode) != KeyEventType::KeyEventType_ASCII)
|
||||
return 0;
|
||||
|
||||
const uint8_t asciiChar = PL_KEY_GET_VALUE(charCode);
|
||||
|
||||
uint16_t menuID;
|
||||
uint16_t itemID;
|
||||
if (PortabilityLayer::MenuManager::GetInstance()->FindMenuShortcut(menuID, itemID, asciiChar))
|
||||
return (menuID << 16) | (itemID + 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
long TickCount()
|
||||
@@ -713,8 +722,8 @@ Window::Window()
|
||||
, m_wmY(0)
|
||||
, m_widgets(nullptr)
|
||||
, m_numWidgets(0)
|
||||
, m_widgetWithFocus(0)
|
||||
, m_haveFocus(false)
|
||||
, m_widgetWithFocus(nullptr)
|
||||
, m_numTickReceivingWidgets(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -762,9 +771,32 @@ bool Window::AddWidget(PortabilityLayer::Widget *widget)
|
||||
|
||||
m_widgets[m_numWidgets++] = widget;
|
||||
|
||||
if (widget->HandlesTickEvents())
|
||||
m_numTickReceivingWidgets++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Window::FocusWidget(PortabilityLayer::Widget *widget)
|
||||
{
|
||||
if (m_widgetWithFocus != widget)
|
||||
{
|
||||
assert(widget->GetWindow() == this);
|
||||
|
||||
if (m_widgetWithFocus)
|
||||
m_widgetWithFocus->LoseFocus();
|
||||
|
||||
m_widgetWithFocus = widget;
|
||||
|
||||
widget->GainFocus();
|
||||
}
|
||||
}
|
||||
|
||||
PortabilityLayer::Widget *Window::GetWidgetWithFocus() const
|
||||
{
|
||||
return m_widgetWithFocus;
|
||||
}
|
||||
|
||||
void Window::DrawControls()
|
||||
{
|
||||
DrawSurface *surface = GetDrawSurface();
|
||||
@@ -776,3 +808,17 @@ void Window::DrawControls()
|
||||
widget->DrawControl(surface);
|
||||
}
|
||||
}
|
||||
|
||||
bool Window::IsHandlingTickEvents()
|
||||
{
|
||||
return m_numTickReceivingWidgets > 0;
|
||||
}
|
||||
|
||||
void Window::OnTick()
|
||||
{
|
||||
if (m_numTickReceivingWidgets == 0)
|
||||
return;
|
||||
|
||||
for (size_t i = 0; i < m_numWidgets; i++)
|
||||
m_widgets[i]->OnTick();
|
||||
}
|
||||
|
@@ -82,7 +82,13 @@ struct Window
|
||||
|
||||
bool AddWidget(PortabilityLayer::Widget *widget);
|
||||
|
||||
void FocusWidget(PortabilityLayer::Widget *widget);
|
||||
PortabilityLayer::Widget *GetWidgetWithFocus() const;
|
||||
|
||||
void DrawControls();
|
||||
bool IsHandlingTickEvents();
|
||||
|
||||
void OnTick();
|
||||
|
||||
DrawSurface m_surface; // Must be the first item until the immediate mode draw API is completely removed
|
||||
|
||||
@@ -96,9 +102,9 @@ protected:
|
||||
|
||||
PortabilityLayer::Widget **m_widgets;
|
||||
size_t m_numWidgets;
|
||||
size_t m_numTickReceivingWidgets;
|
||||
|
||||
size_t m_widgetWithFocus;
|
||||
bool m_haveFocus;
|
||||
PortabilityLayer::Widget *m_widgetWithFocus;
|
||||
};
|
||||
|
||||
struct DateTimeRec
|
||||
@@ -241,7 +247,7 @@ void SetWTitle(WindowPtr window, const PLPasStr &title);
|
||||
|
||||
long MenuSelect(Point point); // Breaks into menu select routine (in practice we'll just forward one from the queue?)
|
||||
|
||||
long MenuKey(int charCode);
|
||||
long MenuKey(intptr_t charCode);
|
||||
long TickCount();
|
||||
|
||||
short LoWord(Int32 v);
|
||||
|
@@ -1,5 +1,9 @@
|
||||
#include "PLDialogs.h"
|
||||
|
||||
#include "DialogManager.h"
|
||||
#include "PLArrayView.h"
|
||||
#include "PLPasStr.h"
|
||||
#include "PLEditboxWidget.h"
|
||||
|
||||
|
||||
DialogTextSubstitutions::DialogTextSubstitutions()
|
||||
@@ -78,7 +82,9 @@ void SetDialogItemText(THandle<Control> handle, const PLPasStr &str)
|
||||
|
||||
void SelectDialogItemText(Dialog *dialog, int item, int firstSelChar, int lastSelCharExclusive)
|
||||
{
|
||||
PL_NotYetImplemented_TODO("TextBox_Critical");
|
||||
PortabilityLayer::EditboxWidget *widget = static_cast<PortabilityLayer::EditboxWidget*>(dialog->GetItems()[item - 1].GetWidget());
|
||||
widget->GetWindow()->FocusWidget(widget);
|
||||
widget->SetSelection(firstSelChar, lastSelCharExclusive);
|
||||
}
|
||||
|
||||
ModalFilterUPP NewModalFilterUPP(ModalFilterUPP func)
|
||||
|
@@ -14,7 +14,7 @@ class PLPasStr;
|
||||
struct Control;
|
||||
struct Dialog;
|
||||
|
||||
typedef int16_t(*DialogFilterFunc_t)(Dialog *dialog, const TimeTaggedVOSEvent &evt);
|
||||
typedef int16_t(*DialogFilterFunc_t)(Dialog *dialog, const TimeTaggedVOSEvent *evt);
|
||||
|
||||
struct DialogTextSubstitutions
|
||||
{
|
||||
|
@@ -1,7 +1,12 @@
|
||||
#include "PLEditboxWidget.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "MemoryManager.h"
|
||||
|
||||
#include "FontFamily.h"
|
||||
#include "InputManager.h"
|
||||
#include "MacRomanConversion.h"
|
||||
#include "MemoryManager.h"
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -14,6 +19,8 @@ namespace PortabilityLayer
|
||||
, m_chars(nullptr)
|
||||
, m_selStartChar(0)
|
||||
, m_selEndChar(0)
|
||||
, m_hasFocus(false)
|
||||
, m_caratTimer(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -48,12 +55,63 @@ namespace PortabilityLayer
|
||||
surface->SetForeColor(StdColors::White());
|
||||
surface->FillRect(innerRect);
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->SetSystemFont(12, PortabilityLayer::FontFamilyFlag_None);
|
||||
int32_t ascender = surface->MeasureFontAscender();
|
||||
int32_t lineGap = surface->MeasureFontLineGap();
|
||||
|
||||
const PLPasStr str = this->GetString();
|
||||
|
||||
assert(m_selStartChar <= str.Length());
|
||||
assert(m_selEndChar <= str.Length());
|
||||
assert(m_selStartChar <= m_selEndChar);
|
||||
|
||||
const char *strChars = str.Chars();
|
||||
|
||||
size_t preSelWidth = 0;
|
||||
size_t selWidth = 0;
|
||||
//size_t postSelWidth = 0;
|
||||
if (m_selStartChar > 0)
|
||||
preSelWidth = surface->MeasureString(PLPasStr(static_cast<uint8_t>(m_selStartChar), strChars));
|
||||
|
||||
if (m_selEndChar > m_selStartChar)
|
||||
selWidth = surface->MeasureString(PLPasStr(static_cast<uint8_t>(m_selEndChar - m_selStartChar), strChars + m_selStartChar));
|
||||
|
||||
//if (m_selEndChar < str.Length())
|
||||
// postSelWidth = surface->MeasureString(PLPasStr(static_cast<uint8_t>(m_selEndChar - str.Length()), strChars + m_selEndChar));
|
||||
|
||||
Point basePoint = Point::Create(textRect.left, (textRect.top + textRect.bottom + ascender + 1) / 2);
|
||||
|
||||
if (m_hasFocus && selWidth > 0)
|
||||
{
|
||||
Rect selRect = Rect::Create(m_rect.top, static_cast<int16_t>(basePoint.h + preSelWidth), m_rect.bottom, m_rect.right);
|
||||
if (m_selEndChar != str.Length())
|
||||
selRect.right = static_cast<int16_t>(basePoint.h + preSelWidth + selWidth);
|
||||
|
||||
selRect = selRect.Intersect(m_rect);
|
||||
|
||||
if (selRect.IsValid())
|
||||
{
|
||||
PortabilityLayer::RGBAColor focusColor = PortabilityLayer::RGBAColor::Create(153, 153, 255, 255);
|
||||
surface->SetForeColor(focusColor);
|
||||
surface->FillRect(selRect);
|
||||
}
|
||||
}
|
||||
|
||||
surface->SetForeColor(StdColors::Black());
|
||||
surface->DrawStringConstrained(basePoint, this->GetString(), true, m_rect);
|
||||
|
||||
if (m_hasFocus && m_selEndChar == m_selStartChar && m_caratTimer < kCaratBlinkRate)
|
||||
{
|
||||
int16_t caratTop = (textRect.top + textRect.bottom - lineGap + 1) / 2;
|
||||
int16_t caratBottom = (textRect.top + textRect.bottom + lineGap + 1) / 2;
|
||||
int16_t caratH = static_cast<int16_t>(basePoint.h + preSelWidth);
|
||||
Rect caratRect = Rect::Create(caratTop, caratH, caratBottom, caratH + 1);
|
||||
|
||||
caratRect = caratRect.Intersect(m_rect);
|
||||
|
||||
if (caratRect.IsValid())
|
||||
surface->FillRect(caratRect);
|
||||
}
|
||||
}
|
||||
|
||||
void EditboxWidget::SetString(const PLPasStr &str)
|
||||
@@ -69,6 +127,11 @@ namespace PortabilityLayer
|
||||
|
||||
DrawControl(surface);
|
||||
}
|
||||
|
||||
if (m_selStartChar > len)
|
||||
m_selStartChar = len;
|
||||
if (m_selEndChar > len)
|
||||
m_selEndChar = len;
|
||||
}
|
||||
|
||||
PLPasStr EditboxWidget::GetString() const
|
||||
@@ -76,4 +139,200 @@ namespace PortabilityLayer
|
||||
const uint8_t len = static_cast<uint8_t>(std::min<size_t>(255, m_length));
|
||||
return PLPasStr(len, reinterpret_cast<const char*>(m_chars));
|
||||
}
|
||||
|
||||
void EditboxWidget::GainFocus()
|
||||
{
|
||||
m_hasFocus = true;
|
||||
m_selStartChar = 0;
|
||||
m_selEndChar = this->GetString().Length();
|
||||
|
||||
if (m_window)
|
||||
{
|
||||
DrawSurface *surface = m_window->GetDrawSurface();
|
||||
DrawControl(surface);
|
||||
}
|
||||
}
|
||||
|
||||
void EditboxWidget::LoseFocus()
|
||||
{
|
||||
m_hasFocus = false;
|
||||
m_selStartChar = 0;
|
||||
m_selEndChar = 0;
|
||||
|
||||
Redraw();
|
||||
}
|
||||
|
||||
WidgetHandleState_t EditboxWidget::ProcessEvent(const TimeTaggedVOSEvent &evt)
|
||||
{
|
||||
if (evt.m_vosEvent.m_eventType == GpVOSEventTypes::kKeyboardInput)
|
||||
{
|
||||
if (!m_hasFocus)
|
||||
return WidgetHandleStates::kIgnored;
|
||||
|
||||
const GpKeyboardInputEvent &keyEvent = evt.m_vosEvent.m_event.m_keyboardInputEvent;
|
||||
|
||||
if (keyEvent.m_eventType == GpKeyboardInputEventTypes::kAutoChar || keyEvent.m_eventType == GpKeyboardInputEventTypes::kDownChar)
|
||||
{
|
||||
// Resolve character
|
||||
bool resolvedChar = false;
|
||||
uint8_t ch = 0;
|
||||
|
||||
if (keyEvent.m_keyIDSubset == GpKeyIDSubsets::kASCII)
|
||||
{
|
||||
ch = static_cast<uint8_t>(keyEvent.m_key.m_asciiChar);
|
||||
resolvedChar = true;
|
||||
}
|
||||
else if (keyEvent.m_keyIDSubset == GpKeyIDSubsets::kUnicode)
|
||||
{
|
||||
uint32_t codePoint = keyEvent.m_key.m_unicodeChar;
|
||||
|
||||
if (codePoint < 0xffff)
|
||||
resolvedChar = MacRoman::FromUnicode(ch, keyEvent.m_key.m_unicodeChar);
|
||||
}
|
||||
|
||||
if (resolvedChar)
|
||||
{
|
||||
if (ch >= 0x20 && ch <= 0x7e)
|
||||
HandleCharacter(ch, keyEvent.m_repeatCount);
|
||||
|
||||
return WidgetHandleStates::kDigested;
|
||||
}
|
||||
}
|
||||
else if (keyEvent.m_eventType == GpKeyboardInputEventTypes::kAuto || keyEvent.m_eventType == GpKeyboardInputEventTypes::kDown)
|
||||
{
|
||||
const KeyDownStates *downStates = PortabilityLayer::InputManager::GetInstance()->GetKeys();
|
||||
const bool isShiftHeld = downStates->m_special.Get(GpKeySpecials::kLeftShift) || downStates->m_special.Get(GpKeySpecials::kRightShift);
|
||||
|
||||
if (keyEvent.m_keyIDSubset == GpKeyIDSubsets::kSpecial)
|
||||
{
|
||||
if (keyEvent.m_key.m_specialKey == GpKeySpecials::kBackspace)
|
||||
{
|
||||
HandleBackspace(keyEvent.m_repeatCount);
|
||||
return WidgetHandleStates::kDigested;
|
||||
}
|
||||
else if (keyEvent.m_key.m_specialKey == GpKeySpecials::kDelete)
|
||||
{
|
||||
return WidgetHandleStates::kDigested;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return WidgetHandleStates::kIgnored;
|
||||
}
|
||||
|
||||
void EditboxWidget::Redraw()
|
||||
{
|
||||
if (m_window)
|
||||
{
|
||||
DrawSurface *surface = m_window->GetDrawSurface();
|
||||
DrawControl(surface);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditboxWidget::HandlesTickEvents() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void EditboxWidget::SetSelection(size_t startChar, size_t endChar)
|
||||
{
|
||||
if (startChar > m_length)
|
||||
startChar = m_length;
|
||||
|
||||
if (endChar < startChar)
|
||||
endChar = startChar;
|
||||
|
||||
if (endChar > m_length)
|
||||
endChar = m_length;
|
||||
|
||||
m_selStartChar = startChar;
|
||||
m_selEndChar = endChar;
|
||||
|
||||
m_caratTimer = 0;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void EditboxWidget::OnTick()
|
||||
{
|
||||
if (m_hasFocus)
|
||||
{
|
||||
m_caratTimer++;
|
||||
if (m_caratTimer == kCaratBlinkRate)
|
||||
Redraw();
|
||||
else if (m_caratTimer == kCaratBlinkRate * 2)
|
||||
{
|
||||
m_caratTimer = 0;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditboxWidget::HandleCharacter(uint8_t ch, const uint32_t numRepeatsRequested)
|
||||
{
|
||||
const size_t numPostSelChars = m_length - m_selEndChar;
|
||||
const size_t numSelChars = m_selEndChar - m_selStartChar;
|
||||
const size_t numPreSelChars = m_selStartChar;
|
||||
|
||||
const size_t lengthWithSelectionRemoved = m_length - numSelChars;
|
||||
const size_t availableInsertions = m_capacity - lengthWithSelectionRemoved;
|
||||
|
||||
const size_t numInsertions = std::min<size_t>(availableInsertions, numRepeatsRequested);
|
||||
|
||||
if (m_selEndChar != m_length)
|
||||
{
|
||||
size_t moveSize = m_length - m_selEndChar;
|
||||
uint8_t *moveSrc = m_chars + m_selEndChar;
|
||||
uint8_t *moveDest = m_chars + m_selStartChar + numInsertions;
|
||||
if (moveSrc != moveDest)
|
||||
memmove(moveDest, moveSrc, numPostSelChars);
|
||||
}
|
||||
|
||||
uint8_t *insertPos = m_chars + m_selStartChar;
|
||||
|
||||
for (size_t r = 0; r < numInsertions; r++)
|
||||
insertPos[r] = ch;
|
||||
|
||||
// Reset selection
|
||||
m_selStartChar += numInsertions;
|
||||
m_selEndChar = m_selStartChar;
|
||||
|
||||
// Reset length;
|
||||
m_length = numPreSelChars + numInsertions + numPostSelChars;
|
||||
|
||||
m_caratTimer = 0;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
void EditboxWidget::HandleBackspace(uint32_t numRepeatsRequested)
|
||||
{
|
||||
const size_t numPostSelChars = m_length - m_selEndChar;
|
||||
const size_t numSelChars = m_selEndChar - m_selStartChar;
|
||||
const size_t numPreSelChars = m_selStartChar;
|
||||
|
||||
size_t prefixTrim = numRepeatsRequested;
|
||||
if (numSelChars != 0)
|
||||
prefixTrim--;
|
||||
|
||||
if (prefixTrim > numPreSelChars)
|
||||
prefixTrim = numPreSelChars;
|
||||
|
||||
const size_t prefixKeep = numPreSelChars - prefixTrim;
|
||||
const size_t suffixKeep = numPostSelChars;
|
||||
|
||||
if (suffixKeep > 0)
|
||||
{
|
||||
uint8_t *moveSrc = m_chars + m_selEndChar;
|
||||
uint8_t *moveDest = m_chars + prefixKeep;
|
||||
|
||||
if (moveSrc != moveDest)
|
||||
memmove(moveDest, moveSrc, suffixKeep);
|
||||
}
|
||||
|
||||
m_length = prefixKeep + suffixKeep;
|
||||
m_selStartChar = m_selEndChar = prefixKeep;
|
||||
|
||||
m_caratTimer = 0;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
@@ -17,11 +17,32 @@ namespace PortabilityLayer
|
||||
void SetString(const PLPasStr &str) override;
|
||||
PLPasStr GetString() const override;
|
||||
|
||||
void GainFocus() override;
|
||||
void LoseFocus() override;
|
||||
|
||||
WidgetHandleState_t ProcessEvent(const TimeTaggedVOSEvent &evt) override;
|
||||
|
||||
bool HandlesTickEvents() const;
|
||||
|
||||
void SetSelection(size_t startChar, size_t endChar);
|
||||
|
||||
private:
|
||||
static const unsigned int kCaratBlinkRate = 20;
|
||||
|
||||
void OnTick() override;
|
||||
void Redraw();
|
||||
|
||||
void HandleCharacter(uint8_t keyChar, const uint32_t numRepeatsRequested);
|
||||
void HandleBackspace(const uint32_t numRepeatsRequested);
|
||||
void HandleForwardDelete(const uint32_t numRepeatsRequested);
|
||||
|
||||
uint8_t *m_chars;
|
||||
size_t m_capacity;
|
||||
size_t m_length;
|
||||
size_t m_selStartChar;
|
||||
size_t m_selEndChar;
|
||||
|
||||
bool m_hasFocus;
|
||||
uint16_t m_caratTimer;
|
||||
};
|
||||
}
|
||||
|
@@ -19,3 +19,8 @@ bool IsRoomEditorDisabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsHighScoreForceTop()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -4,3 +4,4 @@ bool IsMacPlusGraphicBanned();
|
||||
bool IsMacPlusSoundBanned();
|
||||
bool IsHighScoreDisabled();
|
||||
bool IsRoomEditorDisabled();
|
||||
bool IsHighScoreForceTop();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "PLRadioButtonWidget.h"
|
||||
#include "PLStandardColors.h"
|
||||
#include "FontFamily.h"
|
||||
#include "PLTimeTaggedVOSEvent.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -9,6 +10,7 @@ namespace PortabilityLayer
|
||||
RadioButtonWidget::RadioButtonWidget(const WidgetBasicState &state)
|
||||
: WidgetSpec<RadioButtonWidget>(state)
|
||||
, m_text(state.m_text)
|
||||
, m_haveMouseDown(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -68,4 +70,40 @@ namespace PortabilityLayer
|
||||
if (m_window)
|
||||
DrawControl(&m_window->m_surface);
|
||||
}
|
||||
|
||||
WidgetHandleState_t RadioButtonWidget::ProcessEvent(const TimeTaggedVOSEvent &evt)
|
||||
{
|
||||
if (m_haveMouseDown)
|
||||
{
|
||||
if (evt.IsLMouseUpEvent())
|
||||
{
|
||||
m_haveMouseDown = false;
|
||||
|
||||
const Point pt = m_window->MouseToLocal(evt.m_vosEvent.m_event.m_mouseInputEvent);
|
||||
if (m_rect.Contains(pt))
|
||||
return WidgetHandleStates::kActivated;
|
||||
else
|
||||
return WidgetHandleStates::kIgnored;
|
||||
}
|
||||
|
||||
return WidgetHandleStates::kCaptured;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (evt.IsLMouseDownEvent())
|
||||
{
|
||||
const Point pt = m_window->MouseToLocal(evt.m_vosEvent.m_event.m_mouseInputEvent);
|
||||
|
||||
if (m_rect.Contains(pt))
|
||||
{
|
||||
m_haveMouseDown = true;
|
||||
return WidgetHandleStates::kCaptured;
|
||||
}
|
||||
else
|
||||
return WidgetHandleStates::kIgnored;
|
||||
}
|
||||
}
|
||||
|
||||
return WidgetHandleStates::kIgnored;
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,10 @@ namespace PortabilityLayer
|
||||
|
||||
void OnStateChanged() override;
|
||||
|
||||
WidgetHandleState_t ProcessEvent(const TimeTaggedVOSEvent &evt);
|
||||
|
||||
private:
|
||||
PascalStr<255> m_text;
|
||||
bool m_haveMouseDown;
|
||||
};
|
||||
}
|
||||
|
@@ -84,6 +84,19 @@ namespace PortabilityLayer
|
||||
(void)style;
|
||||
}
|
||||
|
||||
bool Widget::HandlesTickEvents() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Widget::GainFocus()
|
||||
{
|
||||
}
|
||||
|
||||
void Widget::LoseFocus()
|
||||
{
|
||||
}
|
||||
|
||||
void Widget::SetString(const PLPasStr &str)
|
||||
{
|
||||
(void)str;
|
||||
@@ -99,6 +112,11 @@ namespace PortabilityLayer
|
||||
return m_rect;
|
||||
}
|
||||
|
||||
Window *Widget::GetWindow() const
|
||||
{
|
||||
return m_window;
|
||||
}
|
||||
|
||||
Widget::Widget(const WidgetBasicState &state)
|
||||
: m_rect(state.m_rect)
|
||||
, m_window(state.m_window)
|
||||
@@ -120,6 +138,10 @@ namespace PortabilityLayer
|
||||
{
|
||||
}
|
||||
|
||||
void Widget::OnTick()
|
||||
{
|
||||
}
|
||||
|
||||
void Widget::BaseRelease(void *storage)
|
||||
{
|
||||
PortabilityLayer::MemoryManager::GetInstance()->Release(storage);
|
||||
|
@@ -64,14 +64,23 @@ namespace PortabilityLayer
|
||||
|
||||
virtual void SetHighlightStyle(int16_t style);
|
||||
|
||||
virtual bool HandlesTickEvents() const;
|
||||
|
||||
const Rect &GetRect() const;
|
||||
Window *GetWindow() const;
|
||||
|
||||
protected:
|
||||
friend struct Window;
|
||||
|
||||
virtual void GainFocus();
|
||||
virtual void LoseFocus();
|
||||
|
||||
explicit Widget(const WidgetBasicState &state);
|
||||
virtual ~Widget();
|
||||
|
||||
virtual void OnEnabledChanged();
|
||||
virtual void OnStateChanged();
|
||||
virtual void OnTick();
|
||||
|
||||
static void BaseRelease(void *storage);
|
||||
static void *BaseAlloc(size_t sz);
|
||||
|
@@ -64,6 +64,7 @@
|
||||
<Import Project="..\MacRomanConversion.props" />
|
||||
<Import Project="..\zlib.props" />
|
||||
<Import Project="..\RapidJSON.props" />
|
||||
<Import Project="..\Release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
@@ -73,6 +74,7 @@
|
||||
<Import Project="..\MacRomanConversion.props" />
|
||||
<Import Project="..\zlib.props" />
|
||||
<Import Project="..\RapidJSON.props" />
|
||||
<Import Project="..\Release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
@@ -91,6 +93,7 @@
|
||||
<Import Project="..\MacRomanConversion.props" />
|
||||
<Import Project="..\zlib.props" />
|
||||
<Import Project="..\RapidJSON.props" />
|
||||
<Import Project="..\Release.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
12
Release.props
Normal file
12
Release.props
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
@@ -1 +0,0 @@
|
||||
"A JSON payload should be an object or array, not a string."
|
@@ -1 +0,0 @@
|
||||
{"Extra value after close": true} "misplaced quoted value"
|
@@ -1 +0,0 @@
|
||||
{"Illegal expression": 1 + 2}
|
@@ -1 +0,0 @@
|
||||
{"Illegal invocation": alert()}
|
@@ -1 +0,0 @@
|
||||
{"Numbers cannot have leading zeroes": 013}
|
@@ -1 +0,0 @@
|
||||
{"Numbers cannot be hex": 0x14}
|
@@ -1 +0,0 @@
|
||||
["Illegal backslash escape: \x15"]
|
@@ -1 +0,0 @@
|
||||
[\naked]
|
@@ -1 +0,0 @@
|
||||
["Illegal backslash escape: \017"]
|
@@ -1 +0,0 @@
|
||||
[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]
|
@@ -1 +0,0 @@
|
||||
{"Missing colon" null}
|
@@ -1 +0,0 @@
|
||||
["Unclosed array"
|
@@ -1 +0,0 @@
|
||||
{"Double colon":: null}
|
@@ -1 +0,0 @@
|
||||
{"Comma instead of colon", null}
|
@@ -1 +0,0 @@
|
||||
["Colon instead of comma": false]
|
@@ -1 +0,0 @@
|
||||
["Bad value", truth]
|
@@ -1 +0,0 @@
|
||||
['single quote']
|
@@ -1 +0,0 @@
|
||||
[" tab character in string "]
|
@@ -1 +0,0 @@
|
||||
["tab\ character\ in\ string\ "]
|
@@ -1,2 +0,0 @@
|
||||
["line
|
||||
break"]
|
@@ -1,2 +0,0 @@
|
||||
["line\
|
||||
break"]
|
@@ -1 +0,0 @@
|
||||
[0e]
|
@@ -1 +0,0 @@
|
||||
{unquoted_key: "keys must be quoted"}
|
@@ -1 +0,0 @@
|
||||
[0e+]
|
@@ -1 +0,0 @@
|
||||
[0e+-1]
|
@@ -1 +0,0 @@
|
||||
{"Comma instead if closing brace": true,
|
@@ -1 +0,0 @@
|
||||
["mismatch"}
|
@@ -1 +0,0 @@
|
||||
["extra comma",]
|
@@ -1 +0,0 @@
|
||||
["double extra comma",,]
|
@@ -1 +0,0 @@
|
||||
[ , "<-- missing value"]
|
@@ -1 +0,0 @@
|
||||
["Comma after the close"],
|
@@ -1 +0,0 @@
|
||||
["Extra close"]]
|
@@ -1 +0,0 @@
|
||||
{"Extra comma": true,}
|
@@ -1,58 +0,0 @@
|
||||
[
|
||||
"JSON Test Pattern pass1",
|
||||
{"object with 1 member":["array with 1 element"]},
|
||||
{},
|
||||
[],
|
||||
-42,
|
||||
true,
|
||||
false,
|
||||
null,
|
||||
{
|
||||
"integer": 1234567890,
|
||||
"real": -9876.543210,
|
||||
"e": 0.123456789e-12,
|
||||
"E": 1.234567890E+34,
|
||||
"": 23456789012E66,
|
||||
"zero": 0,
|
||||
"one": 1,
|
||||
"space": " ",
|
||||
"quote": "\"",
|
||||
"backslash": "\\",
|
||||
"controls": "\b\f\n\r\t",
|
||||
"slash": "/ & \/",
|
||||
"alpha": "abcdefghijklmnopqrstuvwyz",
|
||||
"ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
|
||||
"digit": "0123456789",
|
||||
"0123456789": "digit",
|
||||
"special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
|
||||
"hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
|
||||
"true": true,
|
||||
"false": false,
|
||||
"null": null,
|
||||
"array":[ ],
|
||||
"object":{ },
|
||||
"address": "50 St. James Street",
|
||||
"url": "http://www.JSON.org/",
|
||||
"comment": "// /* <!-- --",
|
||||
"# -- --> */": " ",
|
||||
" s p a c e d " :[1,2 , 3
|
||||
|
||||
,
|
||||
|
||||
4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
|
||||
"jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
|
||||
"quotes": "" \u0022 %22 0x22 034 "",
|
||||
"\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
|
||||
: "A key can be any string"
|
||||
},
|
||||
0.5 ,98.6
|
||||
,
|
||||
99.44
|
||||
,
|
||||
|
||||
1066,
|
||||
1e1,
|
||||
0.1e1,
|
||||
1e-1,
|
||||
1e00,2e+00,2e-00
|
||||
,"rosebud"]
|
@@ -1 +0,0 @@
|
||||
[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"JSON Test Pattern pass3": {
|
||||
"The outermost value": "must be an object or array.",
|
||||
"In this test": "It is an object."
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
Test suite from http://json.org/JSON_checker/.
|
||||
|
||||
If the JSON_checker is working correctly, it must accept all of the pass*.json files and reject all of the fail*.json files.
|
Reference in New Issue
Block a user