├── .gitignore ├── AbsoluteTouch.sln ├── AbsoluteTouch ├── AbsoluteTouch.cpp ├── AbsoluteTouch.vcxproj ├── AbsoluteTouch.vcxproj.filters ├── AbsoluteTouchCallback.cpp ├── AbsoluteTouchCallback.h ├── CCoInitialize.h ├── CommandLineArgs.cpp ├── CommandLineArgs.h ├── Containers.h ├── CoordinateMapper.cpp ├── CoordinateMapper.h ├── Include │ ├── SynCom.h │ ├── SynComDefs.h │ ├── SynCtrl.h │ ├── SynError.h │ ├── SynKit.h │ └── SynWraps.h ├── InputHelper.cpp ├── InputHelper.h ├── TouchProcessor.cpp ├── TouchProcessor.h ├── TouchpadManager.cpp └── TouchpadManager.h ├── LICENSE.txt └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | 84 | # Visual Studio profiler 85 | *.psess 86 | *.vsp 87 | *.vspx 88 | *.sap 89 | 90 | # TFS 2012 Local Workspace 91 | $tf/ 92 | 93 | # Guidance Automation Toolkit 94 | *.gpState 95 | 96 | # ReSharper is a .NET coding add-in 97 | _ReSharper*/ 98 | *.[Rr]e[Ss]harper 99 | *.DotSettings.user 100 | 101 | # JustCode is a .NET coding add-in 102 | .JustCode 103 | 104 | # TeamCity is a build add-in 105 | _TeamCity* 106 | 107 | # DotCover is a Code Coverage Tool 108 | *.dotCover 109 | 110 | # NCrunch 111 | _NCrunch_* 112 | .*crunch*.local.xml 113 | nCrunchTemp_* 114 | 115 | # MightyMoose 116 | *.mm.* 117 | AutoTest.Net/ 118 | 119 | # Web workbench (sass) 120 | .sass-cache/ 121 | 122 | # Installshield output folder 123 | [Ee]xpress/ 124 | 125 | # DocProject is a documentation generator add-in 126 | DocProject/buildhelp/ 127 | DocProject/Help/*.HxT 128 | DocProject/Help/*.HxC 129 | DocProject/Help/*.hhc 130 | DocProject/Help/*.hhk 131 | DocProject/Help/*.hhp 132 | DocProject/Help/Html2 133 | DocProject/Help/html 134 | 135 | # Click-Once directory 136 | publish/ 137 | 138 | # Publish Web Output 139 | *.[Pp]ublish.xml 140 | *.azurePubxml 141 | # TODO: Comment the next line if you want to checkin your web deploy settings 142 | # but database connection strings (with potential passwords) will be unencrypted 143 | *.pubxml 144 | *.publishproj 145 | 146 | # NuGet Packages 147 | *.nupkg 148 | # The packages folder can be ignored because of Package Restore 149 | **/packages/* 150 | # except build/, which is used as an MSBuild target. 151 | !**/packages/build/ 152 | # Uncomment if necessary however generally it will be regenerated when needed 153 | #!**/packages/repositories.config 154 | # NuGet v3's project.json files produces more ignoreable files 155 | *.nuget.props 156 | *.nuget.targets 157 | 158 | # Microsoft Azure Build Output 159 | csx/ 160 | *.build.csdef 161 | 162 | # Microsoft Azure Emulator 163 | ecf/ 164 | rcf/ 165 | 166 | # Windows Store app package directories and files 167 | AppPackages/ 168 | BundleArtifacts/ 169 | Package.StoreAssociation.xml 170 | _pkginfo.txt 171 | 172 | # Visual Studio cache files 173 | # files ending in .cache can be ignored 174 | *.[Cc]ache 175 | # but keep track of directories ending in .cache 176 | !*.[Cc]ache/ 177 | 178 | # Others 179 | ClientBin/ 180 | ~$* 181 | *~ 182 | *.dbmdl 183 | *.dbproj.schemaview 184 | *.pfx 185 | *.publishsettings 186 | node_modules/ 187 | orleans.codegen.cs 188 | 189 | # Since there are multiple workflows, uncomment next line to ignore bower_components 190 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 191 | #bower_components/ 192 | 193 | # RIA/Silverlight projects 194 | Generated_Code/ 195 | 196 | # Backup & report files from converting an old project file 197 | # to a newer Visual Studio version. Backup files are not needed, 198 | # because we have git ;-) 199 | _UpgradeReport_Files/ 200 | Backup*/ 201 | UpgradeLog*.XML 202 | UpgradeLog*.htm 203 | 204 | # SQL Server files 205 | *.mdf 206 | *.ldf 207 | 208 | # Business Intelligence projects 209 | *.rdl.data 210 | *.bim.layout 211 | *.bim_*.settings 212 | 213 | # Microsoft Fakes 214 | FakesAssemblies/ 215 | 216 | # GhostDoc plugin setting file 217 | *.GhostDoc.xml 218 | 219 | # Node.js Tools for Visual Studio 220 | .ntvs_analysis.dat 221 | 222 | # Visual Studio 6 build log 223 | *.plg 224 | 225 | # Visual Studio 6 workspace options file 226 | *.opt 227 | 228 | # Visual Studio LightSwitch build output 229 | **/*.HTMLClient/GeneratedArtifacts 230 | **/*.DesktopClient/GeneratedArtifacts 231 | **/*.DesktopClient/ModelManifest.xml 232 | **/*.Server/GeneratedArtifacts 233 | **/*.Server/ModelManifest.xml 234 | _Pvt_Extensions 235 | 236 | # Paket dependency manager 237 | .paket/paket.exe 238 | 239 | # FAKE - F# Make 240 | .fake/ 241 | 242 | # JetBrains Rider 243 | .idea/ 244 | *.sln.iml 245 | 246 | *.VC.db -------------------------------------------------------------------------------- /AbsoluteTouch.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AbsoluteTouch", "AbsoluteTouch\AbsoluteTouch.vcxproj", "{64860DE3-B3EC-4D88-982A-F65CE99D88E4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4}.Debug|x64.ActiveCfg = Debug|x64 17 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4}.Debug|x64.Build.0 = Debug|x64 18 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4}.Debug|x86.ActiveCfg = Debug|Win32 19 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4}.Debug|x86.Build.0 = Debug|Win32 20 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4}.Release|x64.ActiveCfg = Release|x64 21 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4}.Release|x64.Build.0 = Release|x64 22 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4}.Release|x86.ActiveCfg = Release|Win32 23 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /AbsoluteTouch/AbsoluteTouch.cpp: -------------------------------------------------------------------------------- 1 | #include "CCoInitialize.h" 2 | #include "CommandLineArgs.h" 3 | #include "Containers.h" 4 | #include "CoordinateMapper.h" 5 | #include "InputHelper.h" 6 | #include "TouchProcessor.h" 7 | #include "TouchpadManager.h" 8 | #include "AbsoluteTouchCallback.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define VERSION_NAME "1.4.1" 16 | #define AUTHOR "crossbowffs" 17 | #define PROJECT_URL "https://github.com/apsun/AbsoluteTouch" 18 | 19 | DWORD g_mainThreadId = 0; 20 | std::atomic g_cleanupFinished = false; 21 | TouchpadManager *g_touchpadManager = nullptr; 22 | AbsoluteTouchCallback *g_touchCallback = nullptr; 23 | bool g_touchpadEnabledModified = false; 24 | 25 | void PrintUsage() 26 | { 27 | std::cerr << "usage: AbsoluteTouch.exe \n"; 28 | std::cerr << " -t x1,y1,x2,y2 Set the mapped touchpad region\n"; 29 | std::cerr << " -s x1,y1,x2,y2 Set the mapped screen region\n"; 30 | std::cerr << " -w weight Set the touch smoothing factor\n"; 31 | std::cerr << " -c Enable tap to click\n"; 32 | std::cerr << " -m Enable/disable the touchpad on start/exit\n"; 33 | std::cerr << std::flush; 34 | } 35 | 36 | void CleanUp() 37 | { 38 | std::cout << "--------------------------------------------------" << std::endl; 39 | std::cout << "Exiting..." << std::endl; 40 | if (g_touchpadManager != nullptr) { 41 | if (g_touchpadEnabledModified) { 42 | g_touchpadManager->SetTouchpadEnabled(false); 43 | g_touchpadEnabledModified = false; 44 | std::cout << "Disabled touchpad" << std::endl; 45 | } 46 | 47 | g_touchpadManager->SetTouchCallback(nullptr); 48 | std::cout << "Unregistered touch callback" << std::endl; 49 | 50 | g_touchpadManager->Unacquire(); 51 | std::cout << "Released exclusive touchpad access" << std::endl; 52 | 53 | delete g_touchpadManager; 54 | g_touchpadManager = nullptr; 55 | std::cout << "Uninitialized touchpad manager" << std::endl; 56 | } 57 | 58 | if (g_touchCallback != nullptr) { 59 | delete g_touchCallback; 60 | g_touchCallback = nullptr; 61 | } 62 | } 63 | 64 | BOOL WINAPI OnConsoleSignal(DWORD signal) 65 | { 66 | switch (signal) { 67 | case CTRL_C_EVENT: 68 | case CTRL_BREAK_EVENT: 69 | case CTRL_CLOSE_EVENT: 70 | // Force main thread to break out of message loop 71 | PostThreadMessage(g_mainThreadId, WM_QUIT, 0, 0); 72 | // Wait for main thread to clean up 73 | while (!g_cleanupFinished); 74 | break; 75 | } 76 | return FALSE; 77 | } 78 | 79 | int main(int argc, char *argv[]) 80 | { 81 | CommandLineArgs args(argc, argv); 82 | if (!args.ok) { 83 | PrintUsage(); 84 | return 1; 85 | } 86 | 87 | // Print init info 88 | std::cout << "AbsoluteTouch v" << VERSION_NAME << std::endl; 89 | std::cout << "Author: " << AUTHOR << std::endl; 90 | std::cout << "Project page: " << PROJECT_URL << std::endl; 91 | std::cout << "--------------------------------------------------" << std::endl; 92 | std::cout << "Starting..." << std::endl; 93 | 94 | // Initialize COM 95 | CCoInitialize init; 96 | 97 | // Set cleanup handler 98 | g_mainThreadId = GetCurrentThreadId(); 99 | if (!SetConsoleCtrlHandler(OnConsoleSignal, TRUE)) { 100 | std::cerr << "Error: failed to register console control handler" << std::endl; 101 | CleanUp(); 102 | return 1; 103 | } 104 | std::cout << "Registered console control handler" << std::endl; 105 | 106 | // Initialize touchpad manager 107 | try { 108 | g_touchpadManager = new TouchpadManager(); 109 | } catch (const TouchpadInitException &e) { 110 | std::cerr << "Error: could not initialize touchpad manager" << std::endl; 111 | std::cerr << e.what() << std::endl; 112 | CleanUp(); 113 | return 1; 114 | } 115 | std::cout << "Initialized touchpad manager" << std::endl; 116 | 117 | // Acquire exclusive touchpad access 118 | if (!g_touchpadManager->Acquire()) { 119 | std::cerr << "Error: could not acquire exclusive touchpad access" << std::endl; 120 | CleanUp(); 121 | return 1; 122 | } 123 | std::cout << "Acquired exclusive touchpad access" << std::endl; 124 | 125 | // Register touchpad touch callback 126 | g_touchCallback = new AbsoluteTouchCallback(); 127 | g_touchCallback->SetScreenRect(Rect(0, 0, 65535, 65535).scale(args.screenRect)); 128 | g_touchCallback->SetTouchpadRect(g_touchpadManager->GetTouchpadRect().scale(args.touchpadRect)); 129 | g_touchCallback->SetSmoothingWeight(args.smoothingWeight); 130 | g_touchCallback->SetSendClick(args.sendClick); 131 | g_touchpadManager->SetTouchCallback(g_touchCallback); 132 | std::cout << "Registered touch listener" << std::endl; 133 | 134 | // Enable touchpad if option was specified 135 | if (args.manageTouchpad && !g_touchpadManager->IsTouchpadEnabled()) { 136 | g_touchpadManager->SetTouchpadEnabled(true); 137 | g_touchpadEnabledModified = true; 138 | std::cout << "Enabled touchpad" << std::endl; 139 | } 140 | 141 | // Print usage instructions 142 | std::cout << "--------------------------------------------------" << std::endl; 143 | std::cout << "Initialization complete, absolute touch mode enabled!" << std::endl; 144 | std::cout << "Keep this window open until you wish to exit absolute touch mode." << std::endl; 145 | std::cout << "To exit the program, you can use CTRL-C." << std::endl; 146 | 147 | // Main message loop 148 | MSG msg; 149 | BOOL ret; 150 | while ((ret = GetMessage(&msg, nullptr, 0, 0)) > 0) { 151 | TranslateMessage(&msg); 152 | DispatchMessage(&msg); 153 | } 154 | 155 | CleanUp(); 156 | g_cleanupFinished = true; 157 | return 0; 158 | } 159 | -------------------------------------------------------------------------------- /AbsoluteTouch/AbsoluteTouch.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {64860DE3-B3EC-4D88-982A-F65CE99D88E4} 23 | Win32Proj 24 | AbsoluteTouch 25 | 8.1 26 | AbsoluteTouch 27 | 28 | 29 | 30 | Application 31 | true 32 | v140 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v140 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v140 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v140 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | true 78 | 79 | 80 | false 81 | 82 | 83 | false 84 | 85 | 86 | 87 | 88 | 89 | Level3 90 | Disabled 91 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 92 | 93 | 94 | Console 95 | true 96 | 97 | 98 | 99 | 100 | 101 | 102 | Level3 103 | Disabled 104 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 105 | 106 | 107 | Console 108 | true 109 | 110 | 111 | 112 | 113 | Level3 114 | 115 | 116 | MaxSpeed 117 | true 118 | true 119 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 120 | Speed 121 | Fast 122 | false 123 | 124 | 125 | Console 126 | true 127 | true 128 | true 129 | 130 | 131 | 132 | 133 | Level3 134 | 135 | 136 | MaxSpeed 137 | true 138 | true 139 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 140 | Speed 141 | Fast 142 | false 143 | 144 | 145 | Console 146 | true 147 | true 148 | true 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /AbsoluteTouch/AbsoluteTouch.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Include Headers 16 | 17 | 18 | Include Headers 19 | 20 | 21 | Include Headers 22 | 23 | 24 | Include Headers 25 | 26 | 27 | Include Headers 28 | 29 | 30 | Include Headers 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | Source Files 63 | 64 | 65 | Source Files 66 | 67 | 68 | Source Files 69 | 70 | 71 | Source Files 72 | 73 | 74 | Source Files 75 | 76 | 77 | Source Files 78 | 79 | 80 | -------------------------------------------------------------------------------- /AbsoluteTouch/AbsoluteTouchCallback.cpp: -------------------------------------------------------------------------------- 1 | #include "AbsoluteTouchCallback.h" 2 | #include "Containers.h" 3 | #include "CoordinateMapper.h" 4 | #include "InputHelper.h" 5 | #include "TouchProcessor.h" 6 | #include "TouchpadManager.h" 7 | 8 | void AbsoluteTouchCallback::SetTouchpadRect(Rect touchpadRect) 9 | { 10 | m_coordMapper.SetTouchpadRect(touchpadRect); 11 | } 12 | 13 | void AbsoluteTouchCallback::SetScreenRect(Rect screenRect) 14 | { 15 | m_coordMapper.SetScreenRect(screenRect); 16 | } 17 | 18 | void AbsoluteTouchCallback::SetSmoothingWeight(int weight) 19 | { 20 | m_touchProcessor.SetWeight(weight); 21 | } 22 | 23 | void AbsoluteTouchCallback::SetSendClick(bool sendClick) 24 | { 25 | m_sendClick = sendClick; 26 | } 27 | 28 | void AbsoluteTouchCallback::OnTouchStarted(Point touchPt) 29 | { 30 | Point screenPt = TouchToScreen(touchPt); 31 | if (m_sendClick) { 32 | SendLeftDown(screenPt); 33 | } else { 34 | MoveCursor(screenPt); 35 | } 36 | } 37 | 38 | void AbsoluteTouchCallback::OnTouchMoved(Point touchPt) 39 | { 40 | MoveCursor(TouchToScreen(touchPt)); 41 | } 42 | 43 | void AbsoluteTouchCallback::OnTouchEnded() 44 | { 45 | if (m_sendClick) { 46 | SendLeftUp(); 47 | } 48 | m_touchProcessor.TouchEnded(); 49 | } 50 | 51 | Point AbsoluteTouchCallback::TouchToScreen(Point touchPt) 52 | { 53 | Point avgPt = m_touchProcessor.Update(touchPt); 54 | Point screenPt = m_coordMapper.TouchToScreenCoords(avgPt); 55 | return screenPt; 56 | } 57 | -------------------------------------------------------------------------------- /AbsoluteTouch/AbsoluteTouchCallback.h: -------------------------------------------------------------------------------- 1 | #ifndef ABSOLUTE_TOUCH_CALLBACK_H 2 | #define ABSOLUTE_TOUCH_CALLBACK_H 3 | 4 | #include "Containers.h" 5 | #include "CoordinateMapper.h" 6 | #include "InputHelper.h" 7 | #include "TouchProcessor.h" 8 | #include "TouchpadManager.h" 9 | 10 | class AbsoluteTouchCallback : public TouchCallback 11 | { 12 | public: 13 | void SetTouchpadRect(Rect touchpadRect); 14 | void SetScreenRect(Rect screenRect); 15 | void SetSmoothingWeight(int weight); 16 | void SetSendClick(bool sendClick); 17 | 18 | private: 19 | void OnTouchStarted(Point touchPt) override; 20 | void OnTouchMoved(Point touchPt) override; 21 | void OnTouchEnded() override; 22 | Point TouchToScreen(Point touchPt); 23 | 24 | CoordinateMapper m_coordMapper; 25 | TouchProcessor m_touchProcessor; 26 | bool m_sendClick = false; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /AbsoluteTouch/CCoInitialize.h: -------------------------------------------------------------------------------- 1 | #ifndef C_CO_INITIALIZE 2 | #define C_CO_INITIALIZE 3 | 4 | #include 5 | 6 | class CCoInitialize 7 | { 8 | public: 9 | CCoInitialize() : m_hr(CoInitialize(nullptr)) { } 10 | ~CCoInitialize() { if (SUCCEEDED(m_hr)) CoUninitialize(); } 11 | 12 | private: 13 | HRESULT m_hr; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /AbsoluteTouch/CommandLineArgs.cpp: -------------------------------------------------------------------------------- 1 | #include "CommandLineArgs.h" 2 | #include 3 | #include 4 | #include 5 | 6 | static bool ParseRect(const std::string &str, Rect *out) 7 | { 8 | std::regex re("(\\d+),(\\d+),(\\d+),(\\d+)"); 9 | std::smatch match; 10 | if (!std::regex_match(str, match, re)) 11 | return false; 12 | int x1, y1, x2, y2; 13 | try { 14 | x1 = std::stoi(match[1].str()); 15 | y1 = std::stoi(match[2].str()); 16 | x2 = std::stoi(match[3].str()); 17 | y2 = std::stoi(match[4].str()); 18 | } catch (const std::invalid_argument &) { 19 | return false; 20 | } catch (const std::out_of_range &) { 21 | return false; 22 | } 23 | if (x1 > x2) 24 | return false; 25 | if (y1 > y2) 26 | return false; 27 | out->x1 = x1; 28 | out->y1 = y1; 29 | out->x2 = x2; 30 | out->y2 = y2; 31 | return true; 32 | } 33 | 34 | static bool ParsePercent(const std::string &str, int *out) 35 | { 36 | int value; 37 | try { 38 | value = std::stoi(str); 39 | } catch (const std::invalid_argument &) { 40 | return false; 41 | } catch (const std::out_of_range &) { 42 | return false; 43 | } 44 | if (value < 0 || value > 100) 45 | return false; 46 | *out = value; 47 | return true; 48 | } 49 | 50 | CommandLineArgs::CommandLineArgs(int argc, char *argv[]) 51 | { 52 | for (int i = 1; i < argc; ++i) { 53 | if (std::strcmp(argv[i], "-t") == 0 && i < argc - 1) { 54 | if (!ParseRect(argv[++i], &touchpadRect)) 55 | return; 56 | } else if (std::strcmp(argv[i], "-s") == 0 && i < argc - 1) { 57 | if (!ParseRect(argv[++i], &screenRect)) 58 | return; 59 | } else if (std::strcmp(argv[i], "-w") == 0 && i < argc - 1) { 60 | if (!ParsePercent(argv[++i], &smoothingWeight)) 61 | return; 62 | } else if (std::strcmp(argv[i], "-m") == 0) { 63 | manageTouchpad = true; 64 | } else if (std::strcmp(argv[i], "-c") == 0) { 65 | sendClick = true; 66 | } else { 67 | return; 68 | } 69 | } 70 | ok = true; 71 | } 72 | -------------------------------------------------------------------------------- /AbsoluteTouch/CommandLineArgs.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMAND_LINE_ARGS_H 2 | #define COMMAND_LINE_ARGS_H 3 | 4 | #include "Containers.h" 5 | 6 | class CommandLineArgs 7 | { 8 | public: 9 | CommandLineArgs(int argc, char *argv[]); 10 | bool ok; 11 | Rect screenRect{ 0, 0, 100, 100 }; 12 | Rect touchpadRect{ 0, 0, 100, 100 }; 13 | bool manageTouchpad = false; 14 | bool sendClick = false; 15 | int smoothingWeight = 0; 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /AbsoluteTouch/Containers.h: -------------------------------------------------------------------------------- 1 | #ifndef CONTAINERS_H 2 | #define CONTAINERS_H 3 | 4 | #include 5 | 6 | template 7 | struct Rect 8 | { 9 | T x1; 10 | T y1; 11 | T x2; 12 | T y2; 13 | 14 | Rect() = default; 15 | Rect(T x1, T y1, T x2, T y2) : x1(x1), y1(y1), x2(x2), y2(y2) { } 16 | 17 | T width() 18 | { 19 | return x2 - x1; 20 | } 21 | 22 | T height() 23 | { 24 | return y2 - y1; 25 | } 26 | 27 | Rect scale(Rect scale) 28 | { 29 | Rect ret; 30 | ret.x1 = x1 + width() * scale.x1 / 100; 31 | ret.x2 = x1 + width() * scale.x2 / 100; 32 | ret.y1 = y1 + height() * scale.y1 / 100; 33 | ret.y2 = y1 + height() * scale.y2 / 100; 34 | return ret; 35 | } 36 | }; 37 | 38 | template 39 | std::ostream & operator<<(std::ostream &os, Rect rect) 40 | { 41 | os << "{X1=" << rect.x1 << ", Y1=" << rect.y1; 42 | os << ", X2=" << rect.x2 << ", Y2=" << rect.y2 << "}"; 43 | return os; 44 | } 45 | 46 | template 47 | struct Point 48 | { 49 | T x; 50 | T y; 51 | 52 | Point() = default; 53 | Point(T x, T y) : x(x), y(y) { } 54 | }; 55 | 56 | template 57 | std::ostream & operator<<(std::ostream &os, Point point) 58 | { 59 | os << "(" << point.x << ", " << point.y << ")"; 60 | return os; 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /AbsoluteTouch/CoordinateMapper.cpp: -------------------------------------------------------------------------------- 1 | #include "CoordinateMapper.h" 2 | 3 | void CoordinateMapper::SetTouchpadRect(Rect touchRect) 4 | { 5 | m_touchpadRect = touchRect; 6 | } 7 | 8 | void CoordinateMapper::SetScreenRect(Rect screenRect) 9 | { 10 | m_screenRect = screenRect; 11 | } 12 | 13 | Point CoordinateMapper::ClampTouchPoint(Point touchPoint) 14 | { 15 | if (touchPoint.x < m_touchpadRect.x1) 16 | touchPoint.x = m_touchpadRect.x1; 17 | if (touchPoint.x > m_touchpadRect.x2) 18 | touchPoint.x = m_touchpadRect.x2; 19 | if (touchPoint.y < m_touchpadRect.y1) 20 | touchPoint.y = m_touchpadRect.y1; 21 | if (touchPoint.y > m_touchpadRect.y2) 22 | touchPoint.y = m_touchpadRect.y2; 23 | return touchPoint; 24 | } 25 | 26 | Point CoordinateMapper::TouchToScreenCoords(Point touchPoint) 27 | { 28 | Point clampedTouchPoint = ClampTouchPoint(touchPoint); 29 | long tpWidth = m_touchpadRect.width(); 30 | long tpHeight = m_touchpadRect.height(); 31 | long scWidth = m_screenRect.width(); 32 | long scHeight = m_screenRect.height(); 33 | long tpDeltaX = clampedTouchPoint.x - m_touchpadRect.x1; 34 | long tpDeltaY = clampedTouchPoint.y - m_touchpadRect.y1; 35 | long scDeltaX = tpDeltaX * scWidth / tpWidth; 36 | long scDeltaY = tpDeltaY * scHeight / tpHeight; 37 | long screenX = m_screenRect.x1 + scDeltaX; 38 | long screenY = m_screenRect.y1 + scDeltaY; 39 | return Point(screenX, screenY); 40 | } 41 | -------------------------------------------------------------------------------- /AbsoluteTouch/CoordinateMapper.h: -------------------------------------------------------------------------------- 1 | #ifndef COORDINATE_MAPPER_H 2 | #define COORDINATE_MAPPER_H 3 | 4 | #include "Containers.h" 5 | 6 | class CoordinateMapper 7 | { 8 | public: 9 | Point TouchToScreenCoords(Point touchPoint); 10 | void SetTouchpadRect(Rect rect); 11 | void SetScreenRect(Rect rect); 12 | 13 | private: 14 | Point ClampTouchPoint(Point touchPoint); 15 | Rect m_touchpadRect; 16 | Rect m_screenRect; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /AbsoluteTouch/Include/SynCom.h: -------------------------------------------------------------------------------- 1 | /* this ALWAYS GENERATED file contains the definitions for the interfaces */ 2 | 3 | 4 | /* File created by MIDL compiler version 5.01.0164 */ 5 | /* at Mon Mar 15 17:14:17 2004 6 | */ 7 | /* Compiler settings for C:\src\Driver\SynCom\SynCom\SynCom.idl: 8 | Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext 9 | error checks: allocation ref bounds_check enum stub_data 10 | */ 11 | //@@MIDL_FILE_HEADING( ) 12 | 13 | 14 | /* verify that the version is high enough to compile this file*/ 15 | #ifndef __REQUIRED_RPCNDR_H_VERSION__ 16 | #define __REQUIRED_RPCNDR_H_VERSION__ 440 17 | #endif 18 | 19 | #include "rpc.h" 20 | #include "rpcndr.h" 21 | 22 | #ifndef __RPCNDR_H_VERSION__ 23 | #error this stub requires an updated version of 24 | #endif // __RPCNDR_H_VERSION__ 25 | 26 | #ifndef COM_NO_WINDOWS_H 27 | #include "windows.h" 28 | #include "ole2.h" 29 | #endif /*COM_NO_WINDOWS_H*/ 30 | 31 | #ifndef __SynCom_h__ 32 | #define __SynCom_h__ 33 | 34 | #ifdef __cplusplus 35 | extern "C"{ 36 | #endif 37 | 38 | /* Forward Declarations */ 39 | 40 | #ifndef ___ISynAPIEvents_FWD_DEFINED__ 41 | #define ___ISynAPIEvents_FWD_DEFINED__ 42 | typedef interface _ISynAPIEvents _ISynAPIEvents; 43 | #endif /* ___ISynAPIEvents_FWD_DEFINED__ */ 44 | 45 | 46 | #ifndef ___ISynDeviceEvents_FWD_DEFINED__ 47 | #define ___ISynDeviceEvents_FWD_DEFINED__ 48 | typedef interface _ISynDeviceEvents _ISynDeviceEvents; 49 | #endif /* ___ISynDeviceEvents_FWD_DEFINED__ */ 50 | 51 | 52 | #ifndef ___ISynDisplayEvents_FWD_DEFINED__ 53 | #define ___ISynDisplayEvents_FWD_DEFINED__ 54 | typedef interface _ISynDisplayEvents _ISynDisplayEvents; 55 | #endif /* ___ISynDisplayEvents_FWD_DEFINED__ */ 56 | 57 | 58 | #ifndef __ISynAPI_FWD_DEFINED__ 59 | #define __ISynAPI_FWD_DEFINED__ 60 | typedef interface ISynAPI ISynAPI; 61 | #endif /* __ISynAPI_FWD_DEFINED__ */ 62 | 63 | 64 | #ifndef __ISynDevice_FWD_DEFINED__ 65 | #define __ISynDevice_FWD_DEFINED__ 66 | typedef interface ISynDevice ISynDevice; 67 | #endif /* __ISynDevice_FWD_DEFINED__ */ 68 | 69 | 70 | #ifndef __ISynPacket_FWD_DEFINED__ 71 | #define __ISynPacket_FWD_DEFINED__ 72 | typedef interface ISynPacket ISynPacket; 73 | #endif /* __ISynPacket_FWD_DEFINED__ */ 74 | 75 | 76 | #ifndef __ISynDisplay_FWD_DEFINED__ 77 | #define __ISynDisplay_FWD_DEFINED__ 78 | typedef interface ISynDisplay ISynDisplay; 79 | #endif /* __ISynDisplay_FWD_DEFINED__ */ 80 | 81 | 82 | #ifndef __SynAPI_FWD_DEFINED__ 83 | #define __SynAPI_FWD_DEFINED__ 84 | 85 | #ifdef __cplusplus 86 | typedef class SynAPI SynAPI; 87 | #else 88 | typedef struct SynAPI SynAPI; 89 | #endif /* __cplusplus */ 90 | 91 | #endif /* __SynAPI_FWD_DEFINED__ */ 92 | 93 | 94 | #ifndef __SynDevice_FWD_DEFINED__ 95 | #define __SynDevice_FWD_DEFINED__ 96 | 97 | #ifdef __cplusplus 98 | typedef class SynDevice SynDevice; 99 | #else 100 | typedef struct SynDevice SynDevice; 101 | #endif /* __cplusplus */ 102 | 103 | #endif /* __SynDevice_FWD_DEFINED__ */ 104 | 105 | 106 | #ifndef __SynPacket_FWD_DEFINED__ 107 | #define __SynPacket_FWD_DEFINED__ 108 | 109 | #ifdef __cplusplus 110 | typedef class SynPacket SynPacket; 111 | #else 112 | typedef struct SynPacket SynPacket; 113 | #endif /* __cplusplus */ 114 | 115 | #endif /* __SynPacket_FWD_DEFINED__ */ 116 | 117 | 118 | #ifndef __SynDisplay_FWD_DEFINED__ 119 | #define __SynDisplay_FWD_DEFINED__ 120 | 121 | #ifdef __cplusplus 122 | typedef class SynDisplay SynDisplay; 123 | #else 124 | typedef struct SynDisplay SynDisplay; 125 | #endif /* __cplusplus */ 126 | 127 | #endif /* __SynDisplay_FWD_DEFINED__ */ 128 | 129 | 130 | /* header files for imported files */ 131 | #include "oaidl.h" 132 | #include "ocidl.h" 133 | #include "SynComDefs.h" 134 | 135 | void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); 136 | void __RPC_USER MIDL_user_free( void __RPC_FAR * ); 137 | 138 | /* interface __MIDL_itf_SynCom_0000 */ 139 | /* [local] */ 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | extern RPC_IF_HANDLE __MIDL_itf_SynCom_0000_v0_0_c_ifspec; 149 | extern RPC_IF_HANDLE __MIDL_itf_SynCom_0000_v0_0_s_ifspec; 150 | 151 | #ifndef ___ISynAPIEvents_INTERFACE_DEFINED__ 152 | #define ___ISynAPIEvents_INTERFACE_DEFINED__ 153 | 154 | /* interface _ISynAPIEvents */ 155 | /* [helpstring][uuid][object][local] */ 156 | 157 | 158 | EXTERN_C const IID IID__ISynAPIEvents; 159 | 160 | #if defined(__cplusplus) && !defined(CINTERFACE) 161 | 162 | MIDL_INTERFACE("2566B5BA-ADDC-4cc6-BBFB-B777E5C860CC") 163 | _ISynAPIEvents 164 | { 165 | public: 166 | BEGIN_INTERFACE 167 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE OnSynAPINotify( 168 | long lReason) = 0; 169 | 170 | END_INTERFACE 171 | }; 172 | 173 | #else /* C style interface */ 174 | 175 | typedef struct _ISynAPIEventsVtbl 176 | { 177 | BEGIN_INTERFACE 178 | 179 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *OnSynAPINotify )( 180 | _ISynAPIEvents __RPC_FAR * This, 181 | long lReason); 182 | 183 | END_INTERFACE 184 | } _ISynAPIEventsVtbl; 185 | 186 | interface _ISynAPIEvents 187 | { 188 | CONST_VTBL struct _ISynAPIEventsVtbl __RPC_FAR *lpVtbl; 189 | }; 190 | 191 | 192 | 193 | #ifdef COBJMACROS 194 | 195 | 196 | #define _ISynAPIEvents_OnSynAPINotify(This,lReason) \ 197 | (This)->lpVtbl -> OnSynAPINotify(This,lReason) 198 | 199 | #endif /* COBJMACROS */ 200 | 201 | 202 | #endif /* C style interface */ 203 | 204 | 205 | 206 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE _ISynAPIEvents_OnSynAPINotify_Proxy( 207 | _ISynAPIEvents __RPC_FAR * This, 208 | long lReason); 209 | 210 | 211 | void __RPC_STUB _ISynAPIEvents_OnSynAPINotify_Stub( 212 | IRpcStubBuffer *This, 213 | IRpcChannelBuffer *_pRpcChannelBuffer, 214 | PRPC_MESSAGE _pRpcMessage, 215 | DWORD *_pdwStubPhase); 216 | 217 | 218 | 219 | #endif /* ___ISynAPIEvents_INTERFACE_DEFINED__ */ 220 | 221 | 222 | #ifndef ___ISynDeviceEvents_INTERFACE_DEFINED__ 223 | #define ___ISynDeviceEvents_INTERFACE_DEFINED__ 224 | 225 | /* interface _ISynDeviceEvents */ 226 | /* [helpstring][uuid][object][local] */ 227 | 228 | 229 | EXTERN_C const IID IID__ISynDeviceEvents; 230 | 231 | #if defined(__cplusplus) && !defined(CINTERFACE) 232 | 233 | MIDL_INTERFACE("AE255EED-248F-4998-8376-F063ECB9E220") 234 | _ISynDeviceEvents 235 | { 236 | public: 237 | BEGIN_INTERFACE 238 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE OnSynDevicePacket( 239 | long lSequenceNumber) = 0; 240 | 241 | END_INTERFACE 242 | }; 243 | 244 | #else /* C style interface */ 245 | 246 | typedef struct _ISynDeviceEventsVtbl 247 | { 248 | BEGIN_INTERFACE 249 | 250 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *OnSynDevicePacket )( 251 | _ISynDeviceEvents __RPC_FAR * This, 252 | long lSequenceNumber); 253 | 254 | END_INTERFACE 255 | } _ISynDeviceEventsVtbl; 256 | 257 | interface _ISynDeviceEvents 258 | { 259 | CONST_VTBL struct _ISynDeviceEventsVtbl __RPC_FAR *lpVtbl; 260 | }; 261 | 262 | 263 | 264 | #ifdef COBJMACROS 265 | 266 | 267 | #define _ISynDeviceEvents_OnSynDevicePacket(This,lSequenceNumber) \ 268 | (This)->lpVtbl -> OnSynDevicePacket(This,lSequenceNumber) 269 | 270 | #endif /* COBJMACROS */ 271 | 272 | 273 | #endif /* C style interface */ 274 | 275 | 276 | 277 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE _ISynDeviceEvents_OnSynDevicePacket_Proxy( 278 | _ISynDeviceEvents __RPC_FAR * This, 279 | long lSequenceNumber); 280 | 281 | 282 | void __RPC_STUB _ISynDeviceEvents_OnSynDevicePacket_Stub( 283 | IRpcStubBuffer *This, 284 | IRpcChannelBuffer *_pRpcChannelBuffer, 285 | PRPC_MESSAGE _pRpcMessage, 286 | DWORD *_pdwStubPhase); 287 | 288 | 289 | 290 | #endif /* ___ISynDeviceEvents_INTERFACE_DEFINED__ */ 291 | 292 | 293 | #ifndef ___ISynDisplayEvents_INTERFACE_DEFINED__ 294 | #define ___ISynDisplayEvents_INTERFACE_DEFINED__ 295 | 296 | /* interface _ISynDisplayEvents */ 297 | /* [helpstring][uuid][object][local] */ 298 | 299 | 300 | EXTERN_C const IID IID__ISynDisplayEvents; 301 | 302 | #if defined(__cplusplus) && !defined(CINTERFACE) 303 | 304 | MIDL_INTERFACE("4b55d73c-87d6-4c49-9cf2-ae7654226d68") 305 | _ISynDisplayEvents 306 | { 307 | public: 308 | BEGIN_INTERFACE 309 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE OnSynDisplayMessage( 310 | long lMessage) = 0; 311 | 312 | END_INTERFACE 313 | }; 314 | 315 | #else /* C style interface */ 316 | 317 | typedef struct _ISynDisplayEventsVtbl 318 | { 319 | BEGIN_INTERFACE 320 | 321 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *OnSynDisplayMessage )( 322 | _ISynDisplayEvents __RPC_FAR * This, 323 | long lMessage); 324 | 325 | END_INTERFACE 326 | } _ISynDisplayEventsVtbl; 327 | 328 | interface _ISynDisplayEvents 329 | { 330 | CONST_VTBL struct _ISynDisplayEventsVtbl __RPC_FAR *lpVtbl; 331 | }; 332 | 333 | 334 | 335 | #ifdef COBJMACROS 336 | 337 | 338 | #define _ISynDisplayEvents_OnSynDisplayMessage(This,lMessage) \ 339 | (This)->lpVtbl -> OnSynDisplayMessage(This,lMessage) 340 | 341 | #endif /* COBJMACROS */ 342 | 343 | 344 | #endif /* C style interface */ 345 | 346 | 347 | 348 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE _ISynDisplayEvents_OnSynDisplayMessage_Proxy( 349 | _ISynDisplayEvents __RPC_FAR * This, 350 | long lMessage); 351 | 352 | 353 | void __RPC_STUB _ISynDisplayEvents_OnSynDisplayMessage_Stub( 354 | IRpcStubBuffer *This, 355 | IRpcChannelBuffer *_pRpcChannelBuffer, 356 | PRPC_MESSAGE _pRpcMessage, 357 | DWORD *_pdwStubPhase); 358 | 359 | 360 | 361 | #endif /* ___ISynDisplayEvents_INTERFACE_DEFINED__ */ 362 | 363 | 364 | #ifndef __ISynAPI_INTERFACE_DEFINED__ 365 | #define __ISynAPI_INTERFACE_DEFINED__ 366 | 367 | /* interface ISynAPI */ 368 | /* [helpstring][uuid][object][local] */ 369 | 370 | 371 | EXTERN_C const IID IID_ISynAPI; 372 | 373 | #if defined(__cplusplus) && !defined(CINTERFACE) 374 | 375 | MIDL_INTERFACE("41320763-F0EC-4B7F-9A2E-B4DA92C80FE7") 376 | ISynAPI : public IUnknown 377 | { 378 | public: 379 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize( void) = 0; 380 | 381 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FindDevice( 382 | long lConnectionType, 383 | long lDeviceType, 384 | long __RPC_FAR *ulHandle) = 0; 385 | 386 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateDevice( 387 | long lHandle, 388 | ISynDevice __RPC_FAR *__RPC_FAR *ppDevice) = 0; 389 | 390 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProperty( 391 | long lSpecifier, 392 | long __RPC_FAR *pValue) = 0; 393 | 394 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStringProperty( 395 | long lSpecifier, 396 | TCHAR __RPC_FAR *pBuffer, 397 | long __RPC_FAR *ulBufLen) = 0; 398 | 399 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetProperty( 400 | long lSpecifier, 401 | long lValue) = 0; 402 | 403 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetEventNotification( 404 | HANDLE hEvent) = 0; 405 | 406 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetEventParameter( 407 | long __RPC_FAR *lParameter) = 0; 408 | 409 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE PersistState( 410 | long lStateFlags) = 0; 411 | 412 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RestoreState( 413 | long lStateFlags) = 0; 414 | 415 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE HardwareBroadcast( 416 | long lAction) = 0; 417 | 418 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSynchronousNotification( 419 | _ISynAPIEvents __RPC_FAR *pCallbackInstance) = 0; 420 | 421 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ForwardSystemMessage( 422 | UINT uMsg, 423 | WPARAM wParam, 424 | LPARAM lParam) = 0; 425 | 426 | }; 427 | 428 | #else /* C style interface */ 429 | 430 | typedef struct ISynAPIVtbl 431 | { 432 | BEGIN_INTERFACE 433 | 434 | HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 435 | ISynAPI __RPC_FAR * This, 436 | /* [in] */ REFIID riid, 437 | /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); 438 | 439 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 440 | ISynAPI __RPC_FAR * This); 441 | 442 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 443 | ISynAPI __RPC_FAR * This); 444 | 445 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Initialize )( 446 | ISynAPI __RPC_FAR * This); 447 | 448 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *FindDevice )( 449 | ISynAPI __RPC_FAR * This, 450 | long lConnectionType, 451 | long lDeviceType, 452 | long __RPC_FAR *ulHandle); 453 | 454 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreateDevice )( 455 | ISynAPI __RPC_FAR * This, 456 | long lHandle, 457 | ISynDevice __RPC_FAR *__RPC_FAR *ppDevice); 458 | 459 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProperty )( 460 | ISynAPI __RPC_FAR * This, 461 | long lSpecifier, 462 | long __RPC_FAR *pValue); 463 | 464 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetStringProperty )( 465 | ISynAPI __RPC_FAR * This, 466 | long lSpecifier, 467 | TCHAR __RPC_FAR *pBuffer, 468 | long __RPC_FAR *ulBufLen); 469 | 470 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetProperty )( 471 | ISynAPI __RPC_FAR * This, 472 | long lSpecifier, 473 | long lValue); 474 | 475 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetEventNotification )( 476 | ISynAPI __RPC_FAR * This, 477 | HANDLE hEvent); 478 | 479 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetEventParameter )( 480 | ISynAPI __RPC_FAR * This, 481 | long __RPC_FAR *lParameter); 482 | 483 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PersistState )( 484 | ISynAPI __RPC_FAR * This, 485 | long lStateFlags); 486 | 487 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *RestoreState )( 488 | ISynAPI __RPC_FAR * This, 489 | long lStateFlags); 490 | 491 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *HardwareBroadcast )( 492 | ISynAPI __RPC_FAR * This, 493 | long lAction); 494 | 495 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetSynchronousNotification )( 496 | ISynAPI __RPC_FAR * This, 497 | _ISynAPIEvents __RPC_FAR *pCallbackInstance); 498 | 499 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ForwardSystemMessage )( 500 | ISynAPI __RPC_FAR * This, 501 | UINT uMsg, 502 | WPARAM wParam, 503 | LPARAM lParam); 504 | 505 | END_INTERFACE 506 | } ISynAPIVtbl; 507 | 508 | interface ISynAPI 509 | { 510 | CONST_VTBL struct ISynAPIVtbl __RPC_FAR *lpVtbl; 511 | }; 512 | 513 | 514 | 515 | #ifdef COBJMACROS 516 | 517 | 518 | #define ISynAPI_QueryInterface(This,riid,ppvObject) \ 519 | (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) 520 | 521 | #define ISynAPI_AddRef(This) \ 522 | (This)->lpVtbl -> AddRef(This) 523 | 524 | #define ISynAPI_Release(This) \ 525 | (This)->lpVtbl -> Release(This) 526 | 527 | 528 | #define ISynAPI_Initialize(This) \ 529 | (This)->lpVtbl -> Initialize(This) 530 | 531 | #define ISynAPI_FindDevice(This,lConnectionType,lDeviceType,ulHandle) \ 532 | (This)->lpVtbl -> FindDevice(This,lConnectionType,lDeviceType,ulHandle) 533 | 534 | #define ISynAPI_CreateDevice(This,lHandle,ppDevice) \ 535 | (This)->lpVtbl -> CreateDevice(This,lHandle,ppDevice) 536 | 537 | #define ISynAPI_GetProperty(This,lSpecifier,pValue) \ 538 | (This)->lpVtbl -> GetProperty(This,lSpecifier,pValue) 539 | 540 | #define ISynAPI_GetStringProperty(This,lSpecifier,pBuffer,ulBufLen) \ 541 | (This)->lpVtbl -> GetStringProperty(This,lSpecifier,pBuffer,ulBufLen) 542 | 543 | #define ISynAPI_SetProperty(This,lSpecifier,lValue) \ 544 | (This)->lpVtbl -> SetProperty(This,lSpecifier,lValue) 545 | 546 | #define ISynAPI_SetEventNotification(This,hEvent) \ 547 | (This)->lpVtbl -> SetEventNotification(This,hEvent) 548 | 549 | #define ISynAPI_GetEventParameter(This,lParameter) \ 550 | (This)->lpVtbl -> GetEventParameter(This,lParameter) 551 | 552 | #define ISynAPI_PersistState(This,lStateFlags) \ 553 | (This)->lpVtbl -> PersistState(This,lStateFlags) 554 | 555 | #define ISynAPI_RestoreState(This,lStateFlags) \ 556 | (This)->lpVtbl -> RestoreState(This,lStateFlags) 557 | 558 | #define ISynAPI_HardwareBroadcast(This,lAction) \ 559 | (This)->lpVtbl -> HardwareBroadcast(This,lAction) 560 | 561 | #define ISynAPI_SetSynchronousNotification(This,pCallbackInstance) \ 562 | (This)->lpVtbl -> SetSynchronousNotification(This,pCallbackInstance) 563 | 564 | #define ISynAPI_ForwardSystemMessage(This,uMsg,wParam,lParam) \ 565 | (This)->lpVtbl -> ForwardSystemMessage(This,uMsg,wParam,lParam) 566 | 567 | #endif /* COBJMACROS */ 568 | 569 | 570 | #endif /* C style interface */ 571 | 572 | 573 | 574 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_Initialize_Proxy( 575 | ISynAPI __RPC_FAR * This); 576 | 577 | 578 | void __RPC_STUB ISynAPI_Initialize_Stub( 579 | IRpcStubBuffer *This, 580 | IRpcChannelBuffer *_pRpcChannelBuffer, 581 | PRPC_MESSAGE _pRpcMessage, 582 | DWORD *_pdwStubPhase); 583 | 584 | 585 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_FindDevice_Proxy( 586 | ISynAPI __RPC_FAR * This, 587 | long lConnectionType, 588 | long lDeviceType, 589 | long __RPC_FAR *ulHandle); 590 | 591 | 592 | void __RPC_STUB ISynAPI_FindDevice_Stub( 593 | IRpcStubBuffer *This, 594 | IRpcChannelBuffer *_pRpcChannelBuffer, 595 | PRPC_MESSAGE _pRpcMessage, 596 | DWORD *_pdwStubPhase); 597 | 598 | 599 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_CreateDevice_Proxy( 600 | ISynAPI __RPC_FAR * This, 601 | long lHandle, 602 | ISynDevice __RPC_FAR *__RPC_FAR *ppDevice); 603 | 604 | 605 | void __RPC_STUB ISynAPI_CreateDevice_Stub( 606 | IRpcStubBuffer *This, 607 | IRpcChannelBuffer *_pRpcChannelBuffer, 608 | PRPC_MESSAGE _pRpcMessage, 609 | DWORD *_pdwStubPhase); 610 | 611 | 612 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_GetProperty_Proxy( 613 | ISynAPI __RPC_FAR * This, 614 | long lSpecifier, 615 | long __RPC_FAR *pValue); 616 | 617 | 618 | void __RPC_STUB ISynAPI_GetProperty_Stub( 619 | IRpcStubBuffer *This, 620 | IRpcChannelBuffer *_pRpcChannelBuffer, 621 | PRPC_MESSAGE _pRpcMessage, 622 | DWORD *_pdwStubPhase); 623 | 624 | 625 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_GetStringProperty_Proxy( 626 | ISynAPI __RPC_FAR * This, 627 | long lSpecifier, 628 | TCHAR __RPC_FAR *pBuffer, 629 | long __RPC_FAR *ulBufLen); 630 | 631 | 632 | void __RPC_STUB ISynAPI_GetStringProperty_Stub( 633 | IRpcStubBuffer *This, 634 | IRpcChannelBuffer *_pRpcChannelBuffer, 635 | PRPC_MESSAGE _pRpcMessage, 636 | DWORD *_pdwStubPhase); 637 | 638 | 639 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_SetProperty_Proxy( 640 | ISynAPI __RPC_FAR * This, 641 | long lSpecifier, 642 | long lValue); 643 | 644 | 645 | void __RPC_STUB ISynAPI_SetProperty_Stub( 646 | IRpcStubBuffer *This, 647 | IRpcChannelBuffer *_pRpcChannelBuffer, 648 | PRPC_MESSAGE _pRpcMessage, 649 | DWORD *_pdwStubPhase); 650 | 651 | 652 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_SetEventNotification_Proxy( 653 | ISynAPI __RPC_FAR * This, 654 | HANDLE hEvent); 655 | 656 | 657 | void __RPC_STUB ISynAPI_SetEventNotification_Stub( 658 | IRpcStubBuffer *This, 659 | IRpcChannelBuffer *_pRpcChannelBuffer, 660 | PRPC_MESSAGE _pRpcMessage, 661 | DWORD *_pdwStubPhase); 662 | 663 | 664 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_GetEventParameter_Proxy( 665 | ISynAPI __RPC_FAR * This, 666 | long __RPC_FAR *lParameter); 667 | 668 | 669 | void __RPC_STUB ISynAPI_GetEventParameter_Stub( 670 | IRpcStubBuffer *This, 671 | IRpcChannelBuffer *_pRpcChannelBuffer, 672 | PRPC_MESSAGE _pRpcMessage, 673 | DWORD *_pdwStubPhase); 674 | 675 | 676 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_PersistState_Proxy( 677 | ISynAPI __RPC_FAR * This, 678 | long lStateFlags); 679 | 680 | 681 | void __RPC_STUB ISynAPI_PersistState_Stub( 682 | IRpcStubBuffer *This, 683 | IRpcChannelBuffer *_pRpcChannelBuffer, 684 | PRPC_MESSAGE _pRpcMessage, 685 | DWORD *_pdwStubPhase); 686 | 687 | 688 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_RestoreState_Proxy( 689 | ISynAPI __RPC_FAR * This, 690 | long lStateFlags); 691 | 692 | 693 | void __RPC_STUB ISynAPI_RestoreState_Stub( 694 | IRpcStubBuffer *This, 695 | IRpcChannelBuffer *_pRpcChannelBuffer, 696 | PRPC_MESSAGE _pRpcMessage, 697 | DWORD *_pdwStubPhase); 698 | 699 | 700 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_HardwareBroadcast_Proxy( 701 | ISynAPI __RPC_FAR * This, 702 | long lAction); 703 | 704 | 705 | void __RPC_STUB ISynAPI_HardwareBroadcast_Stub( 706 | IRpcStubBuffer *This, 707 | IRpcChannelBuffer *_pRpcChannelBuffer, 708 | PRPC_MESSAGE _pRpcMessage, 709 | DWORD *_pdwStubPhase); 710 | 711 | 712 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_SetSynchronousNotification_Proxy( 713 | ISynAPI __RPC_FAR * This, 714 | _ISynAPIEvents __RPC_FAR *pCallbackInstance); 715 | 716 | 717 | void __RPC_STUB ISynAPI_SetSynchronousNotification_Stub( 718 | IRpcStubBuffer *This, 719 | IRpcChannelBuffer *_pRpcChannelBuffer, 720 | PRPC_MESSAGE _pRpcMessage, 721 | DWORD *_pdwStubPhase); 722 | 723 | 724 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynAPI_ForwardSystemMessage_Proxy( 725 | ISynAPI __RPC_FAR * This, 726 | UINT uMsg, 727 | WPARAM wParam, 728 | LPARAM lParam); 729 | 730 | 731 | void __RPC_STUB ISynAPI_ForwardSystemMessage_Stub( 732 | IRpcStubBuffer *This, 733 | IRpcChannelBuffer *_pRpcChannelBuffer, 734 | PRPC_MESSAGE _pRpcMessage, 735 | DWORD *_pdwStubPhase); 736 | 737 | 738 | 739 | #endif /* __ISynAPI_INTERFACE_DEFINED__ */ 740 | 741 | 742 | #ifndef __ISynDevice_INTERFACE_DEFINED__ 743 | #define __ISynDevice_INTERFACE_DEFINED__ 744 | 745 | /* interface ISynDevice */ 746 | /* [helpstring][uuid][object][local] */ 747 | 748 | 749 | EXTERN_C const IID IID_ISynDevice; 750 | 751 | #if defined(__cplusplus) && !defined(CINTERFACE) 752 | 753 | MIDL_INTERFACE("E7D5F8AC-866C-4C8C-AF5F-F28DE4918647") 754 | ISynDevice : public IUnknown 755 | { 756 | public: 757 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProperty( 758 | long lSpecifier, 759 | long __RPC_FAR *pValue) = 0; 760 | 761 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetBooleanProperty( 762 | long lSpecifier, 763 | long __RPC_FAR *pValue) = 0; 764 | 765 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStringProperty( 766 | long lSpecifier, 767 | TCHAR __RPC_FAR *pBuffer, 768 | long __RPC_FAR *ulBufLen) = 0; 769 | 770 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetProperty( 771 | long lSpecifier, 772 | long lValue) = 0; 773 | 774 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetEventNotification( 775 | HANDLE hEvent) = 0; 776 | 777 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreatePacket( 778 | ISynPacket __RPC_FAR *__RPC_FAR *ppPacket) = 0; 779 | 780 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE LoadPacket( 781 | ISynPacket __RPC_FAR *pPacket) = 0; 782 | 783 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ForceMotion( 784 | long lDeltaX, 785 | long lDeltaY, 786 | long lButtonState) = 0; 787 | 788 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ForcePacket( 789 | ISynPacket __RPC_FAR *pPacket) = 0; 790 | 791 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Acquire( 792 | long lFlags) = 0; 793 | 794 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Unacquire( void) = 0; 795 | 796 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateDisplay( 797 | ISynDisplay __RPC_FAR *__RPC_FAR *ppDisplay) = 0; 798 | 799 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Select( 800 | long lHandle) = 0; 801 | 802 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE PeekPacket( 803 | long __RPC_FAR *plSequence) = 0; 804 | 805 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSynchronousNotification( 806 | _ISynDeviceEvents __RPC_FAR *pCallbackInstance) = 0; 807 | 808 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertyDefault( 809 | long lSpecifier, 810 | long __RPC_FAR *pValue) = 0; 811 | 812 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE BulkTransaction( 813 | ULONG ulWriteLength, 814 | UCHAR __RPC_FAR *ucWriteBuffer, 815 | ULONG ulReadLength, 816 | UCHAR __RPC_FAR *ucReadBuffer) = 0; 817 | 818 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DiagnosticTransaction( 819 | ULONG ulWriteLength, 820 | UCHAR __RPC_FAR *ucWriteBuffer, 821 | ULONG ulReadLength, 822 | UCHAR __RPC_FAR *ucReadBuffer) = 0; 823 | 824 | }; 825 | 826 | #else /* C style interface */ 827 | 828 | typedef struct ISynDeviceVtbl 829 | { 830 | BEGIN_INTERFACE 831 | 832 | HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 833 | ISynDevice __RPC_FAR * This, 834 | /* [in] */ REFIID riid, 835 | /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); 836 | 837 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 838 | ISynDevice __RPC_FAR * This); 839 | 840 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 841 | ISynDevice __RPC_FAR * This); 842 | 843 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProperty )( 844 | ISynDevice __RPC_FAR * This, 845 | long lSpecifier, 846 | long __RPC_FAR *pValue); 847 | 848 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetBooleanProperty )( 849 | ISynDevice __RPC_FAR * This, 850 | long lSpecifier, 851 | long __RPC_FAR *pValue); 852 | 853 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetStringProperty )( 854 | ISynDevice __RPC_FAR * This, 855 | long lSpecifier, 856 | TCHAR __RPC_FAR *pBuffer, 857 | long __RPC_FAR *ulBufLen); 858 | 859 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetProperty )( 860 | ISynDevice __RPC_FAR * This, 861 | long lSpecifier, 862 | long lValue); 863 | 864 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetEventNotification )( 865 | ISynDevice __RPC_FAR * This, 866 | HANDLE hEvent); 867 | 868 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreatePacket )( 869 | ISynDevice __RPC_FAR * This, 870 | ISynPacket __RPC_FAR *__RPC_FAR *ppPacket); 871 | 872 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *LoadPacket )( 873 | ISynDevice __RPC_FAR * This, 874 | ISynPacket __RPC_FAR *pPacket); 875 | 876 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ForceMotion )( 877 | ISynDevice __RPC_FAR * This, 878 | long lDeltaX, 879 | long lDeltaY, 880 | long lButtonState); 881 | 882 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *ForcePacket )( 883 | ISynDevice __RPC_FAR * This, 884 | ISynPacket __RPC_FAR *pPacket); 885 | 886 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Acquire )( 887 | ISynDevice __RPC_FAR * This, 888 | long lFlags); 889 | 890 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Unacquire )( 891 | ISynDevice __RPC_FAR * This); 892 | 893 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CreateDisplay )( 894 | ISynDevice __RPC_FAR * This, 895 | ISynDisplay __RPC_FAR *__RPC_FAR *ppDisplay); 896 | 897 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Select )( 898 | ISynDevice __RPC_FAR * This, 899 | long lHandle); 900 | 901 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PeekPacket )( 902 | ISynDevice __RPC_FAR * This, 903 | long __RPC_FAR *plSequence); 904 | 905 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetSynchronousNotification )( 906 | ISynDevice __RPC_FAR * This, 907 | _ISynDeviceEvents __RPC_FAR *pCallbackInstance); 908 | 909 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetPropertyDefault )( 910 | ISynDevice __RPC_FAR * This, 911 | long lSpecifier, 912 | long __RPC_FAR *pValue); 913 | 914 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *BulkTransaction )( 915 | ISynDevice __RPC_FAR * This, 916 | ULONG ulWriteLength, 917 | UCHAR __RPC_FAR *ucWriteBuffer, 918 | ULONG ulReadLength, 919 | UCHAR __RPC_FAR *ucReadBuffer); 920 | 921 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *DiagnosticTransaction )( 922 | ISynDevice __RPC_FAR * This, 923 | ULONG ulWriteLength, 924 | UCHAR __RPC_FAR *ucWriteBuffer, 925 | ULONG ulReadLength, 926 | UCHAR __RPC_FAR *ucReadBuffer); 927 | 928 | END_INTERFACE 929 | } ISynDeviceVtbl; 930 | 931 | interface ISynDevice 932 | { 933 | CONST_VTBL struct ISynDeviceVtbl __RPC_FAR *lpVtbl; 934 | }; 935 | 936 | 937 | 938 | #ifdef COBJMACROS 939 | 940 | 941 | #define ISynDevice_QueryInterface(This,riid,ppvObject) \ 942 | (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) 943 | 944 | #define ISynDevice_AddRef(This) \ 945 | (This)->lpVtbl -> AddRef(This) 946 | 947 | #define ISynDevice_Release(This) \ 948 | (This)->lpVtbl -> Release(This) 949 | 950 | 951 | #define ISynDevice_GetProperty(This,lSpecifier,pValue) \ 952 | (This)->lpVtbl -> GetProperty(This,lSpecifier,pValue) 953 | 954 | #define ISynDevice_GetBooleanProperty(This,lSpecifier,pValue) \ 955 | (This)->lpVtbl -> GetBooleanProperty(This,lSpecifier,pValue) 956 | 957 | #define ISynDevice_GetStringProperty(This,lSpecifier,pBuffer,ulBufLen) \ 958 | (This)->lpVtbl -> GetStringProperty(This,lSpecifier,pBuffer,ulBufLen) 959 | 960 | #define ISynDevice_SetProperty(This,lSpecifier,lValue) \ 961 | (This)->lpVtbl -> SetProperty(This,lSpecifier,lValue) 962 | 963 | #define ISynDevice_SetEventNotification(This,hEvent) \ 964 | (This)->lpVtbl -> SetEventNotification(This,hEvent) 965 | 966 | #define ISynDevice_CreatePacket(This,ppPacket) \ 967 | (This)->lpVtbl -> CreatePacket(This,ppPacket) 968 | 969 | #define ISynDevice_LoadPacket(This,pPacket) \ 970 | (This)->lpVtbl -> LoadPacket(This,pPacket) 971 | 972 | #define ISynDevice_ForceMotion(This,lDeltaX,lDeltaY,lButtonState) \ 973 | (This)->lpVtbl -> ForceMotion(This,lDeltaX,lDeltaY,lButtonState) 974 | 975 | #define ISynDevice_ForcePacket(This,pPacket) \ 976 | (This)->lpVtbl -> ForcePacket(This,pPacket) 977 | 978 | #define ISynDevice_Acquire(This,lFlags) \ 979 | (This)->lpVtbl -> Acquire(This,lFlags) 980 | 981 | #define ISynDevice_Unacquire(This) \ 982 | (This)->lpVtbl -> Unacquire(This) 983 | 984 | #define ISynDevice_CreateDisplay(This,ppDisplay) \ 985 | (This)->lpVtbl -> CreateDisplay(This,ppDisplay) 986 | 987 | #define ISynDevice_Select(This,lHandle) \ 988 | (This)->lpVtbl -> Select(This,lHandle) 989 | 990 | #define ISynDevice_PeekPacket(This,plSequence) \ 991 | (This)->lpVtbl -> PeekPacket(This,plSequence) 992 | 993 | #define ISynDevice_SetSynchronousNotification(This,pCallbackInstance) \ 994 | (This)->lpVtbl -> SetSynchronousNotification(This,pCallbackInstance) 995 | 996 | #define ISynDevice_GetPropertyDefault(This,lSpecifier,pValue) \ 997 | (This)->lpVtbl -> GetPropertyDefault(This,lSpecifier,pValue) 998 | 999 | #define ISynDevice_BulkTransaction(This,ulWriteLength,ucWriteBuffer,ulReadLength,ucReadBuffer) \ 1000 | (This)->lpVtbl -> BulkTransaction(This,ulWriteLength,ucWriteBuffer,ulReadLength,ucReadBuffer) 1001 | 1002 | #define ISynDevice_DiagnosticTransaction(This,ulWriteLength,ucWriteBuffer,ulReadLength,ucReadBuffer) \ 1003 | (This)->lpVtbl -> DiagnosticTransaction(This,ulWriteLength,ucWriteBuffer,ulReadLength,ucReadBuffer) 1004 | 1005 | #endif /* COBJMACROS */ 1006 | 1007 | 1008 | #endif /* C style interface */ 1009 | 1010 | 1011 | 1012 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_GetProperty_Proxy( 1013 | ISynDevice __RPC_FAR * This, 1014 | long lSpecifier, 1015 | long __RPC_FAR *pValue); 1016 | 1017 | 1018 | void __RPC_STUB ISynDevice_GetProperty_Stub( 1019 | IRpcStubBuffer *This, 1020 | IRpcChannelBuffer *_pRpcChannelBuffer, 1021 | PRPC_MESSAGE _pRpcMessage, 1022 | DWORD *_pdwStubPhase); 1023 | 1024 | 1025 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_GetBooleanProperty_Proxy( 1026 | ISynDevice __RPC_FAR * This, 1027 | long lSpecifier, 1028 | long __RPC_FAR *pValue); 1029 | 1030 | 1031 | void __RPC_STUB ISynDevice_GetBooleanProperty_Stub( 1032 | IRpcStubBuffer *This, 1033 | IRpcChannelBuffer *_pRpcChannelBuffer, 1034 | PRPC_MESSAGE _pRpcMessage, 1035 | DWORD *_pdwStubPhase); 1036 | 1037 | 1038 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_GetStringProperty_Proxy( 1039 | ISynDevice __RPC_FAR * This, 1040 | long lSpecifier, 1041 | TCHAR __RPC_FAR *pBuffer, 1042 | long __RPC_FAR *ulBufLen); 1043 | 1044 | 1045 | void __RPC_STUB ISynDevice_GetStringProperty_Stub( 1046 | IRpcStubBuffer *This, 1047 | IRpcChannelBuffer *_pRpcChannelBuffer, 1048 | PRPC_MESSAGE _pRpcMessage, 1049 | DWORD *_pdwStubPhase); 1050 | 1051 | 1052 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_SetProperty_Proxy( 1053 | ISynDevice __RPC_FAR * This, 1054 | long lSpecifier, 1055 | long lValue); 1056 | 1057 | 1058 | void __RPC_STUB ISynDevice_SetProperty_Stub( 1059 | IRpcStubBuffer *This, 1060 | IRpcChannelBuffer *_pRpcChannelBuffer, 1061 | PRPC_MESSAGE _pRpcMessage, 1062 | DWORD *_pdwStubPhase); 1063 | 1064 | 1065 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_SetEventNotification_Proxy( 1066 | ISynDevice __RPC_FAR * This, 1067 | HANDLE hEvent); 1068 | 1069 | 1070 | void __RPC_STUB ISynDevice_SetEventNotification_Stub( 1071 | IRpcStubBuffer *This, 1072 | IRpcChannelBuffer *_pRpcChannelBuffer, 1073 | PRPC_MESSAGE _pRpcMessage, 1074 | DWORD *_pdwStubPhase); 1075 | 1076 | 1077 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_CreatePacket_Proxy( 1078 | ISynDevice __RPC_FAR * This, 1079 | ISynPacket __RPC_FAR *__RPC_FAR *ppPacket); 1080 | 1081 | 1082 | void __RPC_STUB ISynDevice_CreatePacket_Stub( 1083 | IRpcStubBuffer *This, 1084 | IRpcChannelBuffer *_pRpcChannelBuffer, 1085 | PRPC_MESSAGE _pRpcMessage, 1086 | DWORD *_pdwStubPhase); 1087 | 1088 | 1089 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_LoadPacket_Proxy( 1090 | ISynDevice __RPC_FAR * This, 1091 | ISynPacket __RPC_FAR *pPacket); 1092 | 1093 | 1094 | void __RPC_STUB ISynDevice_LoadPacket_Stub( 1095 | IRpcStubBuffer *This, 1096 | IRpcChannelBuffer *_pRpcChannelBuffer, 1097 | PRPC_MESSAGE _pRpcMessage, 1098 | DWORD *_pdwStubPhase); 1099 | 1100 | 1101 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_ForceMotion_Proxy( 1102 | ISynDevice __RPC_FAR * This, 1103 | long lDeltaX, 1104 | long lDeltaY, 1105 | long lButtonState); 1106 | 1107 | 1108 | void __RPC_STUB ISynDevice_ForceMotion_Stub( 1109 | IRpcStubBuffer *This, 1110 | IRpcChannelBuffer *_pRpcChannelBuffer, 1111 | PRPC_MESSAGE _pRpcMessage, 1112 | DWORD *_pdwStubPhase); 1113 | 1114 | 1115 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_ForcePacket_Proxy( 1116 | ISynDevice __RPC_FAR * This, 1117 | ISynPacket __RPC_FAR *pPacket); 1118 | 1119 | 1120 | void __RPC_STUB ISynDevice_ForcePacket_Stub( 1121 | IRpcStubBuffer *This, 1122 | IRpcChannelBuffer *_pRpcChannelBuffer, 1123 | PRPC_MESSAGE _pRpcMessage, 1124 | DWORD *_pdwStubPhase); 1125 | 1126 | 1127 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_Acquire_Proxy( 1128 | ISynDevice __RPC_FAR * This, 1129 | long lFlags); 1130 | 1131 | 1132 | void __RPC_STUB ISynDevice_Acquire_Stub( 1133 | IRpcStubBuffer *This, 1134 | IRpcChannelBuffer *_pRpcChannelBuffer, 1135 | PRPC_MESSAGE _pRpcMessage, 1136 | DWORD *_pdwStubPhase); 1137 | 1138 | 1139 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_Unacquire_Proxy( 1140 | ISynDevice __RPC_FAR * This); 1141 | 1142 | 1143 | void __RPC_STUB ISynDevice_Unacquire_Stub( 1144 | IRpcStubBuffer *This, 1145 | IRpcChannelBuffer *_pRpcChannelBuffer, 1146 | PRPC_MESSAGE _pRpcMessage, 1147 | DWORD *_pdwStubPhase); 1148 | 1149 | 1150 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_CreateDisplay_Proxy( 1151 | ISynDevice __RPC_FAR * This, 1152 | ISynDisplay __RPC_FAR *__RPC_FAR *ppDisplay); 1153 | 1154 | 1155 | void __RPC_STUB ISynDevice_CreateDisplay_Stub( 1156 | IRpcStubBuffer *This, 1157 | IRpcChannelBuffer *_pRpcChannelBuffer, 1158 | PRPC_MESSAGE _pRpcMessage, 1159 | DWORD *_pdwStubPhase); 1160 | 1161 | 1162 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_Select_Proxy( 1163 | ISynDevice __RPC_FAR * This, 1164 | long lHandle); 1165 | 1166 | 1167 | void __RPC_STUB ISynDevice_Select_Stub( 1168 | IRpcStubBuffer *This, 1169 | IRpcChannelBuffer *_pRpcChannelBuffer, 1170 | PRPC_MESSAGE _pRpcMessage, 1171 | DWORD *_pdwStubPhase); 1172 | 1173 | 1174 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_PeekPacket_Proxy( 1175 | ISynDevice __RPC_FAR * This, 1176 | long __RPC_FAR *plSequence); 1177 | 1178 | 1179 | void __RPC_STUB ISynDevice_PeekPacket_Stub( 1180 | IRpcStubBuffer *This, 1181 | IRpcChannelBuffer *_pRpcChannelBuffer, 1182 | PRPC_MESSAGE _pRpcMessage, 1183 | DWORD *_pdwStubPhase); 1184 | 1185 | 1186 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_SetSynchronousNotification_Proxy( 1187 | ISynDevice __RPC_FAR * This, 1188 | _ISynDeviceEvents __RPC_FAR *pCallbackInstance); 1189 | 1190 | 1191 | void __RPC_STUB ISynDevice_SetSynchronousNotification_Stub( 1192 | IRpcStubBuffer *This, 1193 | IRpcChannelBuffer *_pRpcChannelBuffer, 1194 | PRPC_MESSAGE _pRpcMessage, 1195 | DWORD *_pdwStubPhase); 1196 | 1197 | 1198 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_GetPropertyDefault_Proxy( 1199 | ISynDevice __RPC_FAR * This, 1200 | long lSpecifier, 1201 | long __RPC_FAR *pValue); 1202 | 1203 | 1204 | void __RPC_STUB ISynDevice_GetPropertyDefault_Stub( 1205 | IRpcStubBuffer *This, 1206 | IRpcChannelBuffer *_pRpcChannelBuffer, 1207 | PRPC_MESSAGE _pRpcMessage, 1208 | DWORD *_pdwStubPhase); 1209 | 1210 | 1211 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_BulkTransaction_Proxy( 1212 | ISynDevice __RPC_FAR * This, 1213 | ULONG ulWriteLength, 1214 | UCHAR __RPC_FAR *ucWriteBuffer, 1215 | ULONG ulReadLength, 1216 | UCHAR __RPC_FAR *ucReadBuffer); 1217 | 1218 | 1219 | void __RPC_STUB ISynDevice_BulkTransaction_Stub( 1220 | IRpcStubBuffer *This, 1221 | IRpcChannelBuffer *_pRpcChannelBuffer, 1222 | PRPC_MESSAGE _pRpcMessage, 1223 | DWORD *_pdwStubPhase); 1224 | 1225 | 1226 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDevice_DiagnosticTransaction_Proxy( 1227 | ISynDevice __RPC_FAR * This, 1228 | ULONG ulWriteLength, 1229 | UCHAR __RPC_FAR *ucWriteBuffer, 1230 | ULONG ulReadLength, 1231 | UCHAR __RPC_FAR *ucReadBuffer); 1232 | 1233 | 1234 | void __RPC_STUB ISynDevice_DiagnosticTransaction_Stub( 1235 | IRpcStubBuffer *This, 1236 | IRpcChannelBuffer *_pRpcChannelBuffer, 1237 | PRPC_MESSAGE _pRpcMessage, 1238 | DWORD *_pdwStubPhase); 1239 | 1240 | 1241 | 1242 | #endif /* __ISynDevice_INTERFACE_DEFINED__ */ 1243 | 1244 | 1245 | #ifndef __ISynPacket_INTERFACE_DEFINED__ 1246 | #define __ISynPacket_INTERFACE_DEFINED__ 1247 | 1248 | /* interface ISynPacket */ 1249 | /* [helpstring][uuid][object][local] */ 1250 | 1251 | 1252 | EXTERN_C const IID IID_ISynPacket; 1253 | 1254 | #if defined(__cplusplus) && !defined(CINTERFACE) 1255 | 1256 | MIDL_INTERFACE("BF9D398B-F631-44B4-8EC0-D3FB3E388B62") 1257 | ISynPacket : public IUnknown 1258 | { 1259 | public: 1260 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProperty( 1261 | long lSpecifier, 1262 | long __RPC_FAR *pValue) = 0; 1263 | 1264 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetProperty( 1265 | long lSpecifier, 1266 | long lValue) = 0; 1267 | 1268 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStringProperty( 1269 | long lSpecifier, 1270 | TCHAR __RPC_FAR *pBuffer, 1271 | long __RPC_FAR *ulBufLen) = 0; 1272 | 1273 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Copy( 1274 | ISynPacket __RPC_FAR *pFrom) = 0; 1275 | 1276 | }; 1277 | 1278 | #else /* C style interface */ 1279 | 1280 | typedef struct ISynPacketVtbl 1281 | { 1282 | BEGIN_INTERFACE 1283 | 1284 | HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 1285 | ISynPacket __RPC_FAR * This, 1286 | /* [in] */ REFIID riid, 1287 | /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); 1288 | 1289 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 1290 | ISynPacket __RPC_FAR * This); 1291 | 1292 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 1293 | ISynPacket __RPC_FAR * This); 1294 | 1295 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProperty )( 1296 | ISynPacket __RPC_FAR * This, 1297 | long lSpecifier, 1298 | long __RPC_FAR *pValue); 1299 | 1300 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetProperty )( 1301 | ISynPacket __RPC_FAR * This, 1302 | long lSpecifier, 1303 | long lValue); 1304 | 1305 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetStringProperty )( 1306 | ISynPacket __RPC_FAR * This, 1307 | long lSpecifier, 1308 | TCHAR __RPC_FAR *pBuffer, 1309 | long __RPC_FAR *ulBufLen); 1310 | 1311 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Copy )( 1312 | ISynPacket __RPC_FAR * This, 1313 | ISynPacket __RPC_FAR *pFrom); 1314 | 1315 | END_INTERFACE 1316 | } ISynPacketVtbl; 1317 | 1318 | interface ISynPacket 1319 | { 1320 | CONST_VTBL struct ISynPacketVtbl __RPC_FAR *lpVtbl; 1321 | }; 1322 | 1323 | 1324 | 1325 | #ifdef COBJMACROS 1326 | 1327 | 1328 | #define ISynPacket_QueryInterface(This,riid,ppvObject) \ 1329 | (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) 1330 | 1331 | #define ISynPacket_AddRef(This) \ 1332 | (This)->lpVtbl -> AddRef(This) 1333 | 1334 | #define ISynPacket_Release(This) \ 1335 | (This)->lpVtbl -> Release(This) 1336 | 1337 | 1338 | #define ISynPacket_GetProperty(This,lSpecifier,pValue) \ 1339 | (This)->lpVtbl -> GetProperty(This,lSpecifier,pValue) 1340 | 1341 | #define ISynPacket_SetProperty(This,lSpecifier,lValue) \ 1342 | (This)->lpVtbl -> SetProperty(This,lSpecifier,lValue) 1343 | 1344 | #define ISynPacket_GetStringProperty(This,lSpecifier,pBuffer,ulBufLen) \ 1345 | (This)->lpVtbl -> GetStringProperty(This,lSpecifier,pBuffer,ulBufLen) 1346 | 1347 | #define ISynPacket_Copy(This,pFrom) \ 1348 | (This)->lpVtbl -> Copy(This,pFrom) 1349 | 1350 | #endif /* COBJMACROS */ 1351 | 1352 | 1353 | #endif /* C style interface */ 1354 | 1355 | 1356 | 1357 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynPacket_GetProperty_Proxy( 1358 | ISynPacket __RPC_FAR * This, 1359 | long lSpecifier, 1360 | long __RPC_FAR *pValue); 1361 | 1362 | 1363 | void __RPC_STUB ISynPacket_GetProperty_Stub( 1364 | IRpcStubBuffer *This, 1365 | IRpcChannelBuffer *_pRpcChannelBuffer, 1366 | PRPC_MESSAGE _pRpcMessage, 1367 | DWORD *_pdwStubPhase); 1368 | 1369 | 1370 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynPacket_SetProperty_Proxy( 1371 | ISynPacket __RPC_FAR * This, 1372 | long lSpecifier, 1373 | long lValue); 1374 | 1375 | 1376 | void __RPC_STUB ISynPacket_SetProperty_Stub( 1377 | IRpcStubBuffer *This, 1378 | IRpcChannelBuffer *_pRpcChannelBuffer, 1379 | PRPC_MESSAGE _pRpcMessage, 1380 | DWORD *_pdwStubPhase); 1381 | 1382 | 1383 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynPacket_GetStringProperty_Proxy( 1384 | ISynPacket __RPC_FAR * This, 1385 | long lSpecifier, 1386 | TCHAR __RPC_FAR *pBuffer, 1387 | long __RPC_FAR *ulBufLen); 1388 | 1389 | 1390 | void __RPC_STUB ISynPacket_GetStringProperty_Stub( 1391 | IRpcStubBuffer *This, 1392 | IRpcChannelBuffer *_pRpcChannelBuffer, 1393 | PRPC_MESSAGE _pRpcMessage, 1394 | DWORD *_pdwStubPhase); 1395 | 1396 | 1397 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynPacket_Copy_Proxy( 1398 | ISynPacket __RPC_FAR * This, 1399 | ISynPacket __RPC_FAR *pFrom); 1400 | 1401 | 1402 | void __RPC_STUB ISynPacket_Copy_Stub( 1403 | IRpcStubBuffer *This, 1404 | IRpcChannelBuffer *_pRpcChannelBuffer, 1405 | PRPC_MESSAGE _pRpcMessage, 1406 | DWORD *_pdwStubPhase); 1407 | 1408 | 1409 | 1410 | #endif /* __ISynPacket_INTERFACE_DEFINED__ */ 1411 | 1412 | 1413 | #ifndef __ISynDisplay_INTERFACE_DEFINED__ 1414 | #define __ISynDisplay_INTERFACE_DEFINED__ 1415 | 1416 | /* interface ISynDisplay */ 1417 | /* [helpstring][uuid][object][local] */ 1418 | 1419 | 1420 | EXTERN_C const IID IID_ISynDisplay; 1421 | 1422 | #if defined(__cplusplus) && !defined(CINTERFACE) 1423 | 1424 | MIDL_INTERFACE("A398ED6B-A2CC-471D-96F7-959610870AE0") 1425 | ISynDisplay : public IUnknown 1426 | { 1427 | public: 1428 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProperty( 1429 | long lSpecifier, 1430 | long __RPC_FAR *pValue) = 0; 1431 | 1432 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetProperty( 1433 | long lSpecifier, 1434 | long lValue) = 0; 1435 | 1436 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE PixelToTouch( 1437 | long PixelX, 1438 | long PixelY, 1439 | long __RPC_FAR *pTouchX, 1440 | long __RPC_FAR *pTouchY) = 0; 1441 | 1442 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TouchToPixel( 1443 | long TouchX, 1444 | long TouchY, 1445 | long __RPC_FAR *pPixelX, 1446 | long __RPC_FAR *pPixelY) = 0; 1447 | 1448 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDC( 1449 | HDC __RPC_FAR *pHDC) = 0; 1450 | 1451 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FlushDC( 1452 | long lFlags) = 0; 1453 | 1454 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Acquire( 1455 | long lDisplayAcquisitionMethod) = 0; 1456 | 1457 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Unacquire( void) = 0; 1458 | 1459 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Select( 1460 | long lDeviceHandle) = 0; 1461 | 1462 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetEventNotification( 1463 | HANDLE hEvent) = 0; 1464 | 1465 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetEventParameter( 1466 | long __RPC_FAR *lParameter) = 0; 1467 | 1468 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetSynchronousNotification( 1469 | _ISynDisplayEvents __RPC_FAR *pCallbackInstance) = 0; 1470 | 1471 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStringProperty( 1472 | long lSpecifier, 1473 | TCHAR __RPC_FAR *pBuffer, 1474 | long __RPC_FAR *ulBufLen) = 0; 1475 | 1476 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetBackgroundImage( 1477 | HBITMAP hBmp) = 0; 1478 | 1479 | virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CloneBackgroundImage( 1480 | HBITMAP __RPC_FAR *pHBmp) = 0; 1481 | 1482 | }; 1483 | 1484 | #else /* C style interface */ 1485 | 1486 | typedef struct ISynDisplayVtbl 1487 | { 1488 | BEGIN_INTERFACE 1489 | 1490 | HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( 1491 | ISynDisplay __RPC_FAR * This, 1492 | /* [in] */ REFIID riid, 1493 | /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); 1494 | 1495 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( 1496 | ISynDisplay __RPC_FAR * This); 1497 | 1498 | ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( 1499 | ISynDisplay __RPC_FAR * This); 1500 | 1501 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProperty )( 1502 | ISynDisplay __RPC_FAR * This, 1503 | long lSpecifier, 1504 | long __RPC_FAR *pValue); 1505 | 1506 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetProperty )( 1507 | ISynDisplay __RPC_FAR * This, 1508 | long lSpecifier, 1509 | long lValue); 1510 | 1511 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *PixelToTouch )( 1512 | ISynDisplay __RPC_FAR * This, 1513 | long PixelX, 1514 | long PixelY, 1515 | long __RPC_FAR *pTouchX, 1516 | long __RPC_FAR *pTouchY); 1517 | 1518 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *TouchToPixel )( 1519 | ISynDisplay __RPC_FAR * This, 1520 | long TouchX, 1521 | long TouchY, 1522 | long __RPC_FAR *pPixelX, 1523 | long __RPC_FAR *pPixelY); 1524 | 1525 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetDC )( 1526 | ISynDisplay __RPC_FAR * This, 1527 | HDC __RPC_FAR *pHDC); 1528 | 1529 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *FlushDC )( 1530 | ISynDisplay __RPC_FAR * This, 1531 | long lFlags); 1532 | 1533 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Acquire )( 1534 | ISynDisplay __RPC_FAR * This, 1535 | long lDisplayAcquisitionMethod); 1536 | 1537 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Unacquire )( 1538 | ISynDisplay __RPC_FAR * This); 1539 | 1540 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Select )( 1541 | ISynDisplay __RPC_FAR * This, 1542 | long lDeviceHandle); 1543 | 1544 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetEventNotification )( 1545 | ISynDisplay __RPC_FAR * This, 1546 | HANDLE hEvent); 1547 | 1548 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetEventParameter )( 1549 | ISynDisplay __RPC_FAR * This, 1550 | long __RPC_FAR *lParameter); 1551 | 1552 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetSynchronousNotification )( 1553 | ISynDisplay __RPC_FAR * This, 1554 | _ISynDisplayEvents __RPC_FAR *pCallbackInstance); 1555 | 1556 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetStringProperty )( 1557 | ISynDisplay __RPC_FAR * This, 1558 | long lSpecifier, 1559 | TCHAR __RPC_FAR *pBuffer, 1560 | long __RPC_FAR *ulBufLen); 1561 | 1562 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetBackgroundImage )( 1563 | ISynDisplay __RPC_FAR * This, 1564 | HBITMAP hBmp); 1565 | 1566 | /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *CloneBackgroundImage )( 1567 | ISynDisplay __RPC_FAR * This, 1568 | HBITMAP __RPC_FAR *pHBmp); 1569 | 1570 | END_INTERFACE 1571 | } ISynDisplayVtbl; 1572 | 1573 | interface ISynDisplay 1574 | { 1575 | CONST_VTBL struct ISynDisplayVtbl __RPC_FAR *lpVtbl; 1576 | }; 1577 | 1578 | 1579 | 1580 | #ifdef COBJMACROS 1581 | 1582 | 1583 | #define ISynDisplay_QueryInterface(This,riid,ppvObject) \ 1584 | (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) 1585 | 1586 | #define ISynDisplay_AddRef(This) \ 1587 | (This)->lpVtbl -> AddRef(This) 1588 | 1589 | #define ISynDisplay_Release(This) \ 1590 | (This)->lpVtbl -> Release(This) 1591 | 1592 | 1593 | #define ISynDisplay_GetProperty(This,lSpecifier,pValue) \ 1594 | (This)->lpVtbl -> GetProperty(This,lSpecifier,pValue) 1595 | 1596 | #define ISynDisplay_SetProperty(This,lSpecifier,lValue) \ 1597 | (This)->lpVtbl -> SetProperty(This,lSpecifier,lValue) 1598 | 1599 | #define ISynDisplay_PixelToTouch(This,PixelX,PixelY,pTouchX,pTouchY) \ 1600 | (This)->lpVtbl -> PixelToTouch(This,PixelX,PixelY,pTouchX,pTouchY) 1601 | 1602 | #define ISynDisplay_TouchToPixel(This,TouchX,TouchY,pPixelX,pPixelY) \ 1603 | (This)->lpVtbl -> TouchToPixel(This,TouchX,TouchY,pPixelX,pPixelY) 1604 | 1605 | #define ISynDisplay_GetDC(This,pHDC) \ 1606 | (This)->lpVtbl -> GetDC(This,pHDC) 1607 | 1608 | #define ISynDisplay_FlushDC(This,lFlags) \ 1609 | (This)->lpVtbl -> FlushDC(This,lFlags) 1610 | 1611 | #define ISynDisplay_Acquire(This,lDisplayAcquisitionMethod) \ 1612 | (This)->lpVtbl -> Acquire(This,lDisplayAcquisitionMethod) 1613 | 1614 | #define ISynDisplay_Unacquire(This) \ 1615 | (This)->lpVtbl -> Unacquire(This) 1616 | 1617 | #define ISynDisplay_Select(This,lDeviceHandle) \ 1618 | (This)->lpVtbl -> Select(This,lDeviceHandle) 1619 | 1620 | #define ISynDisplay_SetEventNotification(This,hEvent) \ 1621 | (This)->lpVtbl -> SetEventNotification(This,hEvent) 1622 | 1623 | #define ISynDisplay_GetEventParameter(This,lParameter) \ 1624 | (This)->lpVtbl -> GetEventParameter(This,lParameter) 1625 | 1626 | #define ISynDisplay_SetSynchronousNotification(This,pCallbackInstance) \ 1627 | (This)->lpVtbl -> SetSynchronousNotification(This,pCallbackInstance) 1628 | 1629 | #define ISynDisplay_GetStringProperty(This,lSpecifier,pBuffer,ulBufLen) \ 1630 | (This)->lpVtbl -> GetStringProperty(This,lSpecifier,pBuffer,ulBufLen) 1631 | 1632 | #define ISynDisplay_SetBackgroundImage(This,hBmp) \ 1633 | (This)->lpVtbl -> SetBackgroundImage(This,hBmp) 1634 | 1635 | #define ISynDisplay_CloneBackgroundImage(This,pHBmp) \ 1636 | (This)->lpVtbl -> CloneBackgroundImage(This,pHBmp) 1637 | 1638 | #endif /* COBJMACROS */ 1639 | 1640 | 1641 | #endif /* C style interface */ 1642 | 1643 | 1644 | 1645 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_GetProperty_Proxy( 1646 | ISynDisplay __RPC_FAR * This, 1647 | long lSpecifier, 1648 | long __RPC_FAR *pValue); 1649 | 1650 | 1651 | void __RPC_STUB ISynDisplay_GetProperty_Stub( 1652 | IRpcStubBuffer *This, 1653 | IRpcChannelBuffer *_pRpcChannelBuffer, 1654 | PRPC_MESSAGE _pRpcMessage, 1655 | DWORD *_pdwStubPhase); 1656 | 1657 | 1658 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_SetProperty_Proxy( 1659 | ISynDisplay __RPC_FAR * This, 1660 | long lSpecifier, 1661 | long lValue); 1662 | 1663 | 1664 | void __RPC_STUB ISynDisplay_SetProperty_Stub( 1665 | IRpcStubBuffer *This, 1666 | IRpcChannelBuffer *_pRpcChannelBuffer, 1667 | PRPC_MESSAGE _pRpcMessage, 1668 | DWORD *_pdwStubPhase); 1669 | 1670 | 1671 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_PixelToTouch_Proxy( 1672 | ISynDisplay __RPC_FAR * This, 1673 | long PixelX, 1674 | long PixelY, 1675 | long __RPC_FAR *pTouchX, 1676 | long __RPC_FAR *pTouchY); 1677 | 1678 | 1679 | void __RPC_STUB ISynDisplay_PixelToTouch_Stub( 1680 | IRpcStubBuffer *This, 1681 | IRpcChannelBuffer *_pRpcChannelBuffer, 1682 | PRPC_MESSAGE _pRpcMessage, 1683 | DWORD *_pdwStubPhase); 1684 | 1685 | 1686 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_TouchToPixel_Proxy( 1687 | ISynDisplay __RPC_FAR * This, 1688 | long TouchX, 1689 | long TouchY, 1690 | long __RPC_FAR *pPixelX, 1691 | long __RPC_FAR *pPixelY); 1692 | 1693 | 1694 | void __RPC_STUB ISynDisplay_TouchToPixel_Stub( 1695 | IRpcStubBuffer *This, 1696 | IRpcChannelBuffer *_pRpcChannelBuffer, 1697 | PRPC_MESSAGE _pRpcMessage, 1698 | DWORD *_pdwStubPhase); 1699 | 1700 | 1701 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_GetDC_Proxy( 1702 | ISynDisplay __RPC_FAR * This, 1703 | HDC __RPC_FAR *pHDC); 1704 | 1705 | 1706 | void __RPC_STUB ISynDisplay_GetDC_Stub( 1707 | IRpcStubBuffer *This, 1708 | IRpcChannelBuffer *_pRpcChannelBuffer, 1709 | PRPC_MESSAGE _pRpcMessage, 1710 | DWORD *_pdwStubPhase); 1711 | 1712 | 1713 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_FlushDC_Proxy( 1714 | ISynDisplay __RPC_FAR * This, 1715 | long lFlags); 1716 | 1717 | 1718 | void __RPC_STUB ISynDisplay_FlushDC_Stub( 1719 | IRpcStubBuffer *This, 1720 | IRpcChannelBuffer *_pRpcChannelBuffer, 1721 | PRPC_MESSAGE _pRpcMessage, 1722 | DWORD *_pdwStubPhase); 1723 | 1724 | 1725 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_Acquire_Proxy( 1726 | ISynDisplay __RPC_FAR * This, 1727 | long lDisplayAcquisitionMethod); 1728 | 1729 | 1730 | void __RPC_STUB ISynDisplay_Acquire_Stub( 1731 | IRpcStubBuffer *This, 1732 | IRpcChannelBuffer *_pRpcChannelBuffer, 1733 | PRPC_MESSAGE _pRpcMessage, 1734 | DWORD *_pdwStubPhase); 1735 | 1736 | 1737 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_Unacquire_Proxy( 1738 | ISynDisplay __RPC_FAR * This); 1739 | 1740 | 1741 | void __RPC_STUB ISynDisplay_Unacquire_Stub( 1742 | IRpcStubBuffer *This, 1743 | IRpcChannelBuffer *_pRpcChannelBuffer, 1744 | PRPC_MESSAGE _pRpcMessage, 1745 | DWORD *_pdwStubPhase); 1746 | 1747 | 1748 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_Select_Proxy( 1749 | ISynDisplay __RPC_FAR * This, 1750 | long lDeviceHandle); 1751 | 1752 | 1753 | void __RPC_STUB ISynDisplay_Select_Stub( 1754 | IRpcStubBuffer *This, 1755 | IRpcChannelBuffer *_pRpcChannelBuffer, 1756 | PRPC_MESSAGE _pRpcMessage, 1757 | DWORD *_pdwStubPhase); 1758 | 1759 | 1760 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_SetEventNotification_Proxy( 1761 | ISynDisplay __RPC_FAR * This, 1762 | HANDLE hEvent); 1763 | 1764 | 1765 | void __RPC_STUB ISynDisplay_SetEventNotification_Stub( 1766 | IRpcStubBuffer *This, 1767 | IRpcChannelBuffer *_pRpcChannelBuffer, 1768 | PRPC_MESSAGE _pRpcMessage, 1769 | DWORD *_pdwStubPhase); 1770 | 1771 | 1772 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_GetEventParameter_Proxy( 1773 | ISynDisplay __RPC_FAR * This, 1774 | long __RPC_FAR *lParameter); 1775 | 1776 | 1777 | void __RPC_STUB ISynDisplay_GetEventParameter_Stub( 1778 | IRpcStubBuffer *This, 1779 | IRpcChannelBuffer *_pRpcChannelBuffer, 1780 | PRPC_MESSAGE _pRpcMessage, 1781 | DWORD *_pdwStubPhase); 1782 | 1783 | 1784 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_SetSynchronousNotification_Proxy( 1785 | ISynDisplay __RPC_FAR * This, 1786 | _ISynDisplayEvents __RPC_FAR *pCallbackInstance); 1787 | 1788 | 1789 | void __RPC_STUB ISynDisplay_SetSynchronousNotification_Stub( 1790 | IRpcStubBuffer *This, 1791 | IRpcChannelBuffer *_pRpcChannelBuffer, 1792 | PRPC_MESSAGE _pRpcMessage, 1793 | DWORD *_pdwStubPhase); 1794 | 1795 | 1796 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_GetStringProperty_Proxy( 1797 | ISynDisplay __RPC_FAR * This, 1798 | long lSpecifier, 1799 | TCHAR __RPC_FAR *pBuffer, 1800 | long __RPC_FAR *ulBufLen); 1801 | 1802 | 1803 | void __RPC_STUB ISynDisplay_GetStringProperty_Stub( 1804 | IRpcStubBuffer *This, 1805 | IRpcChannelBuffer *_pRpcChannelBuffer, 1806 | PRPC_MESSAGE _pRpcMessage, 1807 | DWORD *_pdwStubPhase); 1808 | 1809 | 1810 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_SetBackgroundImage_Proxy( 1811 | ISynDisplay __RPC_FAR * This, 1812 | HBITMAP hBmp); 1813 | 1814 | 1815 | void __RPC_STUB ISynDisplay_SetBackgroundImage_Stub( 1816 | IRpcStubBuffer *This, 1817 | IRpcChannelBuffer *_pRpcChannelBuffer, 1818 | PRPC_MESSAGE _pRpcMessage, 1819 | DWORD *_pdwStubPhase); 1820 | 1821 | 1822 | /* [helpstring] */ HRESULT STDMETHODCALLTYPE ISynDisplay_CloneBackgroundImage_Proxy( 1823 | ISynDisplay __RPC_FAR * This, 1824 | HBITMAP __RPC_FAR *pHBmp); 1825 | 1826 | 1827 | void __RPC_STUB ISynDisplay_CloneBackgroundImage_Stub( 1828 | IRpcStubBuffer *This, 1829 | IRpcChannelBuffer *_pRpcChannelBuffer, 1830 | PRPC_MESSAGE _pRpcMessage, 1831 | DWORD *_pdwStubPhase); 1832 | 1833 | 1834 | 1835 | #endif /* __ISynDisplay_INTERFACE_DEFINED__ */ 1836 | 1837 | 1838 | 1839 | #ifndef __SYNCOMLib_LIBRARY_DEFINED__ 1840 | #define __SYNCOMLib_LIBRARY_DEFINED__ 1841 | 1842 | /* library SYNCOMLib */ 1843 | /* [helpstring][version][uuid] */ 1844 | 1845 | 1846 | EXTERN_C const IID LIBID_SYNCOMLib; 1847 | 1848 | EXTERN_C const CLSID CLSID_SynAPI; 1849 | 1850 | #ifdef __cplusplus 1851 | 1852 | class DECLSPEC_UUID("9C042297-D1CD-4F0D-B1AB-9F48AD6A6DFF") 1853 | SynAPI; 1854 | #endif 1855 | 1856 | EXTERN_C const CLSID CLSID_SynDevice; 1857 | 1858 | #ifdef __cplusplus 1859 | 1860 | class DECLSPEC_UUID("9345312C-D098-4BB1-B2B2-D529EB995173") 1861 | SynDevice; 1862 | #endif 1863 | 1864 | EXTERN_C const CLSID CLSID_SynPacket; 1865 | 1866 | #ifdef __cplusplus 1867 | 1868 | class DECLSPEC_UUID("E0C6335D-27F8-424B-A5C2-561291A902A0") 1869 | SynPacket; 1870 | #endif 1871 | 1872 | EXTERN_C const CLSID CLSID_SynDisplay; 1873 | 1874 | #ifdef __cplusplus 1875 | 1876 | class DECLSPEC_UUID("248AFB1A-27C4-4A30-BF45-6544146648BC") 1877 | SynDisplay; 1878 | #endif 1879 | #endif /* __SYNCOMLib_LIBRARY_DEFINED__ */ 1880 | 1881 | /* Additional Prototypes for ALL interfaces */ 1882 | 1883 | /* end of Additional Prototypes */ 1884 | 1885 | #ifdef __cplusplus 1886 | } 1887 | #endif 1888 | 1889 | #endif 1890 | -------------------------------------------------------------------------------- /AbsoluteTouch/Include/SynComDefs.h: -------------------------------------------------------------------------------- 1 | // This file contains basic type definitions for the Synaptics SDK 2 | 3 | #ifndef __SYNCOMDEFS_H_ 4 | #define __SYNCOMDEFS_H_ 5 | 6 | #ifndef __SYNCTRLLib_LIBRARY_DEFINED__ 7 | 8 | // Property specifiers 9 | 10 | // API property specifiers 11 | 12 | enum SynAPIProperty { 13 | SP_First = 0x10000000, 14 | SP_Version, 15 | SP_SynComDllVersion = SP_Version, 16 | SP_MaxDevices, 17 | SP_DevicesPresent, 18 | SP_DriverVersion, 19 | SP_RequiredDriverVersion, 20 | SP_APILast = SP_First + 0x100 21 | }; 22 | 23 | // Device property specifiers 24 | 25 | enum SynDeviceProperty { 26 | SP_DeviceFirst = SP_APILast, 27 | // Direct values (cached). 28 | SP_Handle, 29 | SP_DeviceType, 30 | SP_ConnectionType, 31 | 32 | SP_FWVersion, 33 | SP_Geometry, 34 | SP_SensorType, 35 | SP_ProductType, 36 | SP_ASICType = SP_ProductType + 2, 37 | SP_ReportRate = SP_ASICType + 4, 38 | SP_Gestures, 39 | SP_SecondaryGestures, 40 | SP_EdgeMotionOptions, 41 | SP_EdgeMotionSpeed, 42 | SP_MotionRotationAngle, 43 | 44 | SP_XDPI, 45 | SP_YDPI, 46 | SP_XLoSensor, 47 | SP_YLoSensor, 48 | SP_XHiSensor, 49 | SP_YHiSensor, 50 | SP_XLoRim, 51 | SP_YLoRim, 52 | SP_XHiRim, 53 | SP_YHiRim, 54 | SP_XLoBorder, 55 | SP_YLoBorder, 56 | SP_XHiBorder, 57 | SP_YHiBorder, 58 | SP_YLoBorderVScroll, 59 | SP_YHiBorderVScroll, 60 | SP_XLoWideBorder, 61 | SP_YLoWideBorder, 62 | SP_XHiWideBorder, 63 | SP_YHiWideBorder, 64 | SP_ZMaximum, 65 | SP_ZTouchThreshold, 66 | 67 | SP_TopLeftCornerWidth, 68 | SP_TopLeftCornerHeight, 69 | SP_TopRightCornerWidth, 70 | SP_TopRightCornerHeight, 71 | SP_BottomRightCornerWidth, 72 | SP_BottomRightCornerHeight, 73 | SP_BottomLeftCornerWidth, 74 | SP_BottomLeftCornerHeight, 75 | 76 | SP_TopLeftCornerAction, 77 | SP_TopRightCornerAction, 78 | SP_BottomRightCornerAction, 79 | SP_BottomLeftCornerAction, 80 | 81 | SP_LeftButtonAction, 82 | SP_RightButtonAction, 83 | SP_BothButtonAction, 84 | SP_MiddleButtonAction, 85 | SP_UpButtonAction, 86 | SP_DownButtonAction, 87 | SP_Ex1ButtonAction, 88 | SP_Ex2ButtonAction, 89 | SP_Ex3ButtonAction, 90 | SP_Ex4ButtonAction, 91 | SP_Ex5ButtonAction, 92 | SP_Ex6ButtonAction, 93 | SP_Ex7ButtonAction, 94 | SP_Ex8ButtonAction, 95 | 96 | SP_ExtendedButtons, 97 | 98 | // Boolean properties. 99 | SP_HasMiddleButton, 100 | SP_HasUpDownButtons, 101 | 102 | SP_IsMultiFingerCapable, 103 | SP_IsPenCapable, 104 | SP_IsVScroll, 105 | SP_IsHScroll, 106 | SP_IsWEMode, 107 | SP_IsLowReportRate, 108 | SP_IsHighReportRate, 109 | 110 | SP_IsTapEnabled, 111 | SP_IsDragEnabled, 112 | SP_IsDragLockEnabled, 113 | SP_IsCornerTapEnabled, 114 | SP_IsEdgeMotionEnabled, 115 | SP_IsEdgeMotionDragEnabled, 116 | SP_IsEdgeMotionMoveEnabled, 117 | 118 | SP_IsReleaseToSelectEnabled, 119 | SP_IsMiddleTapToHelpEnabled, 120 | SP_IsMiddleButtonBlockEnabled, 121 | SP_IsPressureDragEnabled, 122 | SP_Is3ButtonEnabled, 123 | SP_IsPressureEdgeMotionEnabled, 124 | SP_IsMiddleButtonLock, 125 | 126 | // Button 4 & 5 support 127 | SP_Button4Action, 128 | SP_Button5Action, 129 | 130 | // Somewhat vetted enhancements app properties. 131 | SP_VerticalScrollingFlags = SP_Button5Action + 17, 132 | SP_HorizontalScrollingFlags, 133 | 134 | // New COM specific properties 135 | SP_DisplayFlags, 136 | 137 | // Newer properties. 138 | SP_ModelId, 139 | SP_DisableState, 140 | 141 | SP_DeviceLast = SP_DeviceFirst + 0x200 142 | }; 143 | 144 | // Packet property specifiers 145 | 146 | enum SynPacketProperty { 147 | SP_PacketFirst = SP_DeviceLast, 148 | SP_AssociatedDeviceHandle, 149 | SP_SequenceNumber, 150 | SP_TimeStamp, 151 | SP_XRaw, 152 | SP_ZXRaw = SP_XRaw, 153 | SP_YRaw, 154 | SP_ZRaw, 155 | SP_ZYRaw, 156 | SP_W, 157 | SP_X, 158 | SP_Y, 159 | SP_Z, 160 | SP_XDelta, 161 | SP_YDelta, 162 | SP_ZDelta, 163 | SP_XMickeys, 164 | SP_YMickeys, 165 | SP_AnachronisticState, 166 | SP_FingerState, 167 | SP_ExtendedState, 168 | SP_ButtonState, 169 | SP_ExtraFingerState, 170 | SP_PacketLast = SP_PacketFirst + 0x100 171 | }; 172 | 173 | // Display property specifiers 174 | 175 | enum SynDisplayProperty { 176 | SP_DisplayFirst = SP_PacketLast, 177 | SP_BackLightState, 178 | SP_DisplayRows, 179 | SP_DisplayColumns, 180 | SP_DisplayOwned, 181 | SP_BackLightOnOffOnce, 182 | SP_DisplayLast = SP_DisplayFirst + 0x100 183 | }; 184 | 185 | // String properties 186 | 187 | // API strings. 188 | 189 | enum SynAPIStringProperty { 190 | SP_StringFirst = SP_DisplayLast, 191 | SP_APIStringFirst = SP_StringFirst, 192 | SP_VersionString, 193 | SP_APIStringLast = SP_APIStringFirst + 0x100 194 | }; 195 | 196 | // Device strings. 197 | 198 | enum SynDeviceStringProperty { 199 | SP_DeviceStringFirst = SP_APIStringLast, 200 | SP_ModelString, 201 | SP_PnPID, 202 | SP_ShortName, 203 | SP_DeviceStringLast = SP_DeviceStringFirst + 0x100, 204 | SP_StringLast = SP_DeviceStringLast 205 | }; 206 | 207 | 208 | // For use with ISynAPI::FindDevice 209 | 210 | // The various types of devices. 211 | enum SynDeviceType { 212 | SE_DeviceAny, 213 | SE_DeviceUnknown = SE_DeviceAny, 214 | SE_DeviceMouse, 215 | SE_DeviceTouchPad, 216 | SE_DeviceWheelMouse, 217 | SE_DeviceIBMCompatibleStick, 218 | SE_DeviceStyk, 219 | SE_DeviceFiveButtonWheelMouse, 220 | SE_DevicecPad, 221 | SE_DeviceTouchScreen = SE_DeviceTouchPad 222 | }; 223 | 224 | // The various ways that devices may be connected. 225 | enum SynConnectionType { 226 | SE_ConnectionAny, 227 | SE_ConnectionCOM, 228 | SE_ConnectionPS2, 229 | SE_ConnectionUSB, 230 | SE_ConnectionUnknown = SE_ConnectionAny 231 | }; 232 | 233 | // Interpret notification reasons returned by ISynAPI::GetEventParameter 234 | enum SynNotificationReason 235 | { 236 | SE_Configuration_Changed = 0x00000001, 237 | SE_DeviceRemoved = 0x00000002, 238 | SE_DeviceAdded = 0x00000004, 239 | SE_InternalPS2DeviceDisabled = 0x00000008, 240 | SE_InternalPS2DeviceInCompatibilityMode = 0x00000010 241 | // Specialized Enhancements App notifications are not passed through 242 | // in this release. 243 | }; 244 | 245 | // Interpretation of SP_ButtonState, each bit indicates a particular button. 246 | enum SynButtonFlags { // Not fleshed-out yet. 247 | SF_ButtonLeft = 0x00000001, 248 | SF_ButtonRight = 0x00000002, 249 | SF_ButtonMiddle = 0x00000004, 250 | SF_ButtonUp = 0x00000010, 251 | SF_ButtonDown = 0x00000020, 252 | SF_Button4 = 0x00000040, 253 | SF_Button5 = 0x00000080, 254 | SF_ButtonExtended1 = 0x00000100, 255 | SF_ButtonExtended2 = 0x00000200, 256 | SF_ButtonExtended3 = 0x00000400, 257 | SF_ButtonExtended4 = 0x00000800, 258 | SF_ButtonExtended5 = 0x00001000, 259 | SF_ButtonExtended6 = 0x00002000, 260 | SF_ButtonExtended7 = 0x00004000, 261 | SF_ButtonExtended8 = 0x00008000, 262 | SF_ButtonReportedLeft = 0x00010000, 263 | SF_ButtonReportedRight = 0x00020000, 264 | SF_ButtonReportedMiddle = 0x00040000, 265 | SF_ButtonReported4 = 0x00080000, 266 | SF_ButtonReported5 = 0x01000000, 267 | SF_ButtonVirtualLeft = 0x00100000, 268 | SF_ButtonVirtualRight = 0x00200000, 269 | SF_ButtonVirtualMiddle = 0x00400000, 270 | SF_ButtonVirtual4 = 0x00800000, 271 | SF_ButtonVirtual5 = 0x02000000, 272 | SF_ButtonAnyVirtual = 0x02f00000, 273 | SF_ButtonAnyReported = 0x010f0000, 274 | SF_ButtonAnyPhysical = 0x0000ffff, 275 | SF_ButtonAny = 0x03ffffff 276 | }; 277 | 278 | 279 | // Interpretation of vertical and horizontal scrolling flags. 280 | enum SynScrollingFlags { 281 | SF_ScrollingEnabled = 0x00000001, 282 | SF_ScrollingEdgeMotion = 0x00000002, 283 | SF_ScrollingMomentum = 0x00000004, 284 | SF_ScrollingUnderPointer = 0x00000008, 285 | SF_ScrollingReversed = 0x00000040, 286 | SF_ScrollingAxisSwapped = 0x00000080 287 | }; 288 | 289 | // Interpretation of vertical and horizontal scrolling flags. 290 | enum SynHardwareBroadcastFlags { 291 | SF_Detect, 292 | SF_Configure, 293 | }; 294 | 295 | enum SynPersistFlags { 296 | SF_PersistMachine 297 | }; 298 | 299 | enum SynFingerFlags { 300 | SF_FingerProx = 0x00000200, // Z exceeds proximity threshold. 301 | SF_FingerTouch = 0x00000400, // Z exceeds touch threshold. 302 | SF_FingerHeavy = 0x00000800, // Z exceeds heavy touch threshold. 303 | SF_FingerPress = 0x00001000, // "Press hard" gesture in progress. 304 | SF_FingerPresent = 0x00002000, // Finger present on TouchPad. 305 | SF_FingerPossTap = 0x00004000, // Early stroke, tap still possible. 306 | SF_FingerStylus = 0x00008000, // Stylus present on TouchPad. 307 | 308 | SF_FingerTap = 0x00010000, // Tap gesture in progress. 309 | SF_FingerDrag = 0x00020000, // Drag gesture in progress. 310 | SF_FingerDragLock = 0x00040000, // Drag-lock gesture in progress. 311 | SF_FingerPrimGest = 0x00080000, // Primary gesture in progress. 312 | SF_FingerSecGest = 0x00100000, // Secondary gesture in progress. 313 | SF_FingerAuxGest = 0x00200000, // Auxiliary gesture in progress. 314 | SF_FingerMotion = 0x00400000, // Motion deltas are non-zero. 315 | SF_FingerMoving = 0x00800000, // Significant finger motion. 316 | 317 | SF_FingerTopLeftTap = 0x01000000, // Tap in zone in progress. 318 | SF_FingerTopRightTap = 0x02000000, // Tap in zone in progress. 319 | SF_FingerBottomLeftTap = 0x04000000, // Tap in zone in progress. 320 | SF_FingerBottomRightTap = 0x08000000, // Tap in zone in progress. 321 | 322 | // Flags for multi finger pads 323 | SF_FingerTap2 = 0x40000000, // 2 finger tap 324 | SF_FingerTap3 = 0x80000000, // 3+ finger tap 325 | 326 | SF_FingerAllCorner = 0x0F000000, // Corner gestures. 327 | SF_FingerAllTap = 0xCF000000, // Any and all taps 328 | SF_FingerAsButton = 0xCF380000, // Finger state as buttons 329 | SF_FingerAllGest = 0xCF3F1000, // Any and all gestures. 330 | }; 331 | 332 | enum SynStateFlags { 333 | SF_StateFinger = 0x00002000 334 | }; 335 | 336 | enum SynExtendedStateFlags { 337 | SF_StateScrollFinger = 0x00000100 // Finger in scroll area 338 | }; 339 | 340 | enum SynDisplayFlags { 341 | SF_DisplayNone, 342 | SF_DisplayPresent = 0x00000001 343 | }; 344 | 345 | enum SynFlushMethod { 346 | SE_FlushSynchronous, 347 | SE_FlushAsynchronous 348 | }; 349 | 350 | enum SynDisplayAquisitionMethod { 351 | SE_AcquireCooperative, 352 | SE_AcquireExclusive, 353 | SE_AcquirePassive 354 | }; 355 | 356 | // This version of the Synaptics SDK requires a driver version of at least 357 | // the following. The Synaptics driver version can be obtained using the 358 | // SP_DriverVersion property of the SynAPI interface. 359 | enum SynRequiredVersion { 360 | SE_RequiredDriverVersion = 0x07080300, 361 | SE_RequiredSynCOMDllVersion = 0x07080300, 362 | }; 363 | 364 | // Interpret notification messages returned by ISynDisplay::GetEventParameter 365 | enum SynDisplayMessage 366 | { 367 | SE_AcquisitionLost = 0x00000001, 368 | SE_AcquisitionGained = 0x00000002, 369 | SE_BackgroundImageChanged = 0x00000003, 370 | }; 371 | 372 | // Use with SP_Gestures to enable or disable certain gestures. 373 | enum SynGestures { 374 | SF_GestureTap = 0x00000001, // Enable tap gestures. 375 | SF_GesturePressToSelect = 0x00000001, // Enable press to select gestures. 376 | SF_GestureDrag = 0x00000002, // Enable drag gestures. 377 | SF_GestureDragLock = 0x00000004, // Enable drag lock. 378 | SF_GesturePressureDrag = 0x00000008, // Press-to-drag. 379 | SF_GestureReleaseToSelect = 0x00000010, // Enable Release-to-Select 380 | SF_GestureMiddleTapToHelp = 0x00000020, // 3-middle button taps to help 381 | SF_GestureMiddleButtonLock = 0x00000040, // Middle Button Lock state 382 | SF_GestureMiddleButtonBlock= 0x00000080, // Middle Button Block state 383 | SF_GestureTapMask = 0x00000007, // Mask for tap gestures. 384 | SF_GestureAll = 0x000000FF 385 | }; 386 | 387 | // Use with SP_*Action properties to associate an action with a particular 388 | // device event. 389 | enum SynActions { 390 | SF_ActionNone = 0x00000000, // Generate no gestures 391 | SF_ActionPrimary = 0x00000001, // Generate primary gestures 392 | SF_ActionSecondary = 0x00000002, // Generate secondary gestures 393 | SF_ActionAuxilliary = 0x00000004, // Generate auxiliary gestures 394 | SF_ActionAll = 0x00000007 395 | }; 396 | 397 | enum SynAcquisitionFlags { // Use with SynDevice::Acquire 398 | SF_AcquireAll = 0x00000000, // Acquire both motion and buttons. 399 | SF_AcquireMotionOnly = 0x00000001 // Let button changes through to OS. 400 | }; 401 | 402 | #endif 403 | #endif -------------------------------------------------------------------------------- /AbsoluteTouch/Include/SynError.h: -------------------------------------------------------------------------------- 1 | //=========================================================================== 2 | // Copyright (c) 1996, Synaptics, Inc. 3 | // 4 | // This file is Confidential Synaptics Information. 5 | // 6 | // This file and all modified and derivative files thereof are 7 | // Restricted Code for the Synaptics/Microsoft Driver Distribution Agreement. 8 | // 9 | // The Synaptics TouchPad and related software are protected by one or more 10 | // of the U.S. patents whose numbers can be found in the PatentNumbers.h 11 | // file in the lib directory of this source tree, as well as other U.S. and 12 | // International patents pending. 13 | // 14 | // RCS Header - Do not delete or modify. 15 | // 16 | // $RCSfile: SynError.h,v $ 17 | // $Source: /cvs/software/Driver/SynCom/SynCom/SynError.h,v $ 18 | // $Revision: 1.3 $ 19 | // $Date: 2003/02/19 18:33:48 $ 20 | // $Author: pausbeck $ 21 | // $Locker: $ 22 | // $State: Exp $ 23 | //=========================================================================== 24 | 25 | //--------------------------------------------------------------------------- 26 | // SynError.h 27 | // Possible Synaptics COM API return values. 28 | //--------------------------------------------------------------------------- 29 | 30 | #ifndef __SYNERROR_H 31 | #define __SYNERROR_H 32 | 33 | #define SYN_OK ((HRESULT)0x00000000L) 34 | 35 | #define SYN_FALSE ((HRESULT)0x00000000L) 36 | #define SYN_TRUE ((HRESULT)0x00000001L) 37 | 38 | #define SYNE_HANDLE E_HANDLE 39 | #define SYNE_FAIL E_FAIL 40 | #define SYNE_INVALIDARG E_INVALIDARG 41 | #define SYNE_OUTOFMEMORY E_OUTOFMEMORY 42 | #define SYNE_ACCESSDENIED E_ACCESSDENIED 43 | #define SYNE_NOTIMPL E_NOTIMPL 44 | #define SYNE_SEQUENCE E_UNEXPECTED 45 | 46 | #define SYNE_NOTFOUND \ 47 | MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) 48 | 49 | #endif -------------------------------------------------------------------------------- /AbsoluteTouch/Include/SynKit.h: -------------------------------------------------------------------------------- 1 | // Public header file for access to the Synaptics COM API/Toolkit. 2 | 3 | #ifndef __SYNKIT_H 4 | #define __SYNKIT_H 5 | 6 | #if !defined(SYN_INCLUDE_NO_CONTROLS) && (!defined(_MFC_VER) || defined(SYN_INCLUDE_CONTROLS)) 7 | // Include controls by default only for non-MFC programs. 8 | // MFC programs likely will import the type library and add controls to dialogs which will 9 | // automatically create MFC wrapper classes for the controls. 10 | // If controls are included, inlcude them first as the enumerations are in the type library. 11 | #include "SynCtrl.h" 12 | #endif 13 | 14 | #include "SynCom.h" 15 | #include "SynError.h" 16 | #include "SynWraps.h" 17 | 18 | STDAPI SynCreateAPI(ISynAPI **ppAPI); 19 | 20 | // Declare GUIDs here so that controls can be imported into MFC even if 21 | // SYN_INCLUDE_NO_CONTROLS has been defined. 22 | // Define SYN_INCLUDE_NO_CONTROLS to allow classwizard to reuse the ISynXXX 23 | // names when using MFC to import the synctrl.dll class library. 24 | class DECLSPEC_UUID("F418EBA0-6A10-4482-AC2B-2D10C807073A") SynAPICtrl; 25 | class DECLSPEC_UUID("a220a2df-406f-4d68-9b62-995669ae0c92") SynPacketCtrl; 26 | class DECLSPEC_UUID("2060435E-AB52-49E1-A2EA-5D31645887CF") SynDeviceCtrl; 27 | 28 | 29 | #endif -------------------------------------------------------------------------------- /AbsoluteTouch/Include/SynWraps.h: -------------------------------------------------------------------------------- 1 | // Public header file for access to the Synaptics COM API/Toolkit. 2 | 3 | #ifndef __SYNWRAPS_H 4 | #define __SYNWRAPS_H 5 | 6 | #include 7 | 8 | template class SynWrap 9 | { 10 | public: 11 | SynWrap() 12 | { 13 | m_pInternal = 0; // Fault reliably if a SynWrap can't be created. 14 | 15 | DoThreadCoInitialize(); 16 | CoCreateInstance(_uuidof(Object), 0, CLSCTX_SERVER, 17 | _uuidof(Interface), (void **) &m_pInternal); 18 | } 19 | 20 | SynWrap(LPCOLESTR psProgID) 21 | { 22 | CLSID clsid; 23 | m_pInternal = 0; // Fault reliably if a SynWrap can't be created. 24 | 25 | DoThreadCoInitialize(); 26 | CLSIDFromProgID( psProgID, &clsid ); 27 | CoCreateInstance(clsid, 0, CLSCTX_SERVER, 28 | _uuidof(Interface), (void **) &m_pInternal); 29 | } 30 | 31 | SynWrap(Interface *pDevice) 32 | { 33 | m_pInternal = pDevice; 34 | if (m_pInternal) 35 | pDevice->AddRef(); 36 | } 37 | 38 | ~SynWrap() 39 | { 40 | if (m_pInternal) 41 | m_pInternal->Release(); 42 | } 43 | 44 | operator Interface *() { return m_pInternal; } 45 | 46 | Interface *operator->() { return m_pInternal; } 47 | 48 | long GetLongProperty(long lSpecifier) const 49 | { 50 | long lProperty = 0; 51 | 52 | if (m_pInternal) 53 | m_pInternal->GetProperty(lSpecifier, &lProperty); 54 | return lProperty; 55 | } 56 | 57 | _bstr_t GetStringProperty (long lSpecifier) 58 | { 59 | char buf[256]; 60 | long ulSize = sizeof(buf); 61 | buf[0] = 0; 62 | 63 | if (m_pInternal) 64 | m_pInternal->GetStringProperty(lSpecifier, buf, &ulSize); 65 | return _bstr_t(buf); 66 | } 67 | 68 | Interface *m_pInternal; 69 | 70 | private: 71 | void DoThreadCoInitialize() 72 | { 73 | static DWORD s_dwTlsIndex = TlsAlloc(); 74 | if (!TlsGetValue(s_dwTlsIndex)) { // These are initted to NULL for each thread. 75 | CoInitialize(0); 76 | TlsSetValue(s_dwTlsIndex, (PVOID)1); 77 | } 78 | } 79 | }; 80 | 81 | template class SynWrapEvents : 82 | public SynWrap, 83 | public Events 84 | { 85 | public: 86 | SynWrapEvents() { } 87 | SynWrapEvents(LPCOLESTR psProgID) : SynWrap(psProgID){ } 88 | SynWrapEvents(Interface *pDevice) : SynWrap(pDevice) { } 89 | ~SynWrapEvents() { } 90 | 91 | HRESULT Activate() 92 | { 93 | HRESULT res = SYNE_FAIL; 94 | if (m_pInternal) 95 | res = m_pInternal->SetSynchronousNotification(this); 96 | 97 | return res; 98 | } 99 | 100 | HRESULT Deactivate() 101 | { 102 | HRESULT res = SYNE_FAIL; 103 | if (m_pInternal) 104 | res = m_pInternal->SetSynchronousNotification(0); 105 | 106 | return res; 107 | } 108 | 109 | HRESULT STDMETHODCALLTYPE OnSynAPINotify(long /* lReason */) { return 0; } 110 | HRESULT STDMETHODCALLTYPE OnSynDevicePacket(long /* lSequence */) { return 0; } 111 | HRESULT STDMETHODCALLTYPE OnSynDisplayMessage(long /* lMessage */) { return 0; } 112 | }; 113 | 114 | class SynAPI : 115 | public SynWrapEvents 116 | { 117 | public: 118 | SynAPI() : 119 | SynWrapEvents(L"SynCom.SynAPI") { } 120 | 121 | SynAPI(ISynAPI *pInterface) : 122 | SynWrapEvents(pInterface) { } 123 | 124 | HRESULT STDMETHODCALLTYPE OnSynAPINotify(long /* lReason */) { return 0; } 125 | 126 | 127 | long FindDevice(enum SynConnectionType eConnectionType, 128 | enum SynDeviceType eDeviceType, long lStart) 129 | { 130 | if (m_pInternal) 131 | { 132 | return m_pInternal->FindDevice(eConnectionType, eDeviceType, &lStart) 133 | ? -1 : lStart; 134 | } 135 | else 136 | return -1; 137 | } 138 | }; 139 | 140 | class SynDevice : 141 | public SynWrapEvents 142 | { 143 | public: 144 | SynDevice() : 145 | SynWrapEvents(L"SynCom.PointingDevice") { } 146 | 147 | SynDevice(ISynDevice *pInterface) : 148 | SynWrapEvents(pInterface) { } 149 | 150 | long GetLongPropertyDefault(long lSpecifier) 151 | { 152 | long lProperty = 0; 153 | 154 | if (m_pInternal) 155 | m_pInternal->GetPropertyDefault(lSpecifier, &lProperty); 156 | return lProperty; 157 | } 158 | 159 | HRESULT STDMETHODCALLTYPE OnSynDevicePacket(long /* lSequence */) { return 0; } 160 | 161 | bool IsTouchPad() { 162 | return (SE_DeviceTouchPad == GetLongProperty(SP_DeviceType)); 163 | } 164 | 165 | bool IsStyk() { 166 | return (SE_DeviceStyk == GetLongProperty(SP_DeviceType)); 167 | } 168 | 169 | bool IsIBMCompatibleStick() { 170 | return (SE_DeviceIBMCompatibleStick == GetLongProperty(SP_DeviceType)); 171 | } 172 | 173 | bool IsStykOrIBMCompatibleStick() { 174 | return (IsStyk() || IsIBMCompatibleStick()); 175 | } 176 | 177 | bool IscPad() { 178 | return IsTouchPad() && 179 | !!(GetLongProperty(SP_DisplayFlags) & SF_DisplayPresent); 180 | } 181 | 182 | bool IsStandardMouse() { 183 | return (SE_DeviceMouse == GetLongProperty(SP_DeviceType)); 184 | } 185 | 186 | bool IsWheelMouse() { 187 | return (SE_DeviceWheelMouse == GetLongProperty(SP_DeviceType)); 188 | } 189 | 190 | bool IsFiveButtonWheelMouse() { 191 | return (SE_DeviceFiveButtonWheelMouse == GetLongProperty(SP_DeviceType)); 192 | } 193 | 194 | bool IsMouse() { 195 | return (IsStandardMouse() || IsWheelMouse() || IsFiveButtonWheelMouse()); 196 | } 197 | 198 | bool IsUSBDevice() { 199 | return (SE_ConnectionUSB == GetLongProperty(SP_ConnectionType)); 200 | } 201 | 202 | bool IsPS2Device() { 203 | return (SE_ConnectionPS2 == GetLongProperty(SP_ConnectionType)); 204 | } 205 | }; 206 | 207 | class SynDisplay : 208 | public SynWrapEvents 209 | { 210 | public: 211 | SynDisplay() : 212 | SynWrapEvents(L"SynCom.SynDisplay") { } 213 | 214 | SynDisplay(ISynDisplay *pInterface) : 215 | SynWrapEvents(pInterface) { } 216 | 217 | HRESULT STDMETHODCALLTYPE OnSynDisplayMessage(long /* lMessage */) { return 0; } 218 | 219 | long PixelX(long lTouchX) 220 | { 221 | long lPixelX = 0, lPixelY = 0; 222 | if (m_pInternal) 223 | { 224 | m_pInternal->TouchToPixel(lTouchX, 0, &lPixelX, &lPixelY); 225 | } 226 | 227 | return lPixelX; 228 | } 229 | 230 | long PixelY(long lTouchY) 231 | { 232 | long lPixelX = 0, lPixelY = 0; 233 | if (m_pInternal) 234 | { 235 | m_pInternal->TouchToPixel(0, lTouchY, &lPixelX, &lPixelY); 236 | } 237 | 238 | return lPixelY; 239 | } 240 | 241 | long TouchX(long lPixelX) 242 | { 243 | long lTouchX = 0, lTouchY = 0; 244 | if (m_pInternal) 245 | { 246 | m_pInternal->PixelToTouch(lPixelX, 0, &lTouchX, &lTouchY); 247 | } 248 | 249 | return lTouchX; 250 | } 251 | 252 | long TouchY(long lPixelY) 253 | { 254 | long lTouchX = 0, lTouchY = 0; 255 | if (m_pInternal) 256 | { 257 | m_pInternal->PixelToTouch(0, lPixelY, &lTouchX, &lTouchY); 258 | } 259 | 260 | return lTouchY; 261 | } 262 | }; 263 | 264 | class SynPacket : 265 | public SynWrap 266 | { 267 | public: 268 | SynPacket() : SynWrap(L"SynCom.SynPacket") { } 269 | 270 | SynPacket(ISynPacket *pPacket) : SynWrap(pPacket) { } 271 | 272 | long AssociatedDeviceHandle() const 273 | { 274 | long lProperty; 275 | m_pInternal->GetProperty(SP_AssociatedDeviceHandle, &lProperty); 276 | return lProperty; 277 | } 278 | 279 | long SequenceNumber() const 280 | { 281 | long lProperty; 282 | m_pInternal->GetProperty(SP_SequenceNumber, &lProperty); 283 | return lProperty; 284 | } 285 | 286 | unsigned long TimeStamp() const 287 | { 288 | unsigned long ulProperty; 289 | m_pInternal->GetProperty(SP_TimeStamp, (long *) &ulProperty); 290 | return ulProperty; 291 | } 292 | 293 | long W() const 294 | { 295 | long lProperty; 296 | m_pInternal->GetProperty(SP_W, &lProperty); 297 | return lProperty; 298 | } 299 | 300 | long X() const 301 | { 302 | long lProperty; 303 | m_pInternal->GetProperty(SP_X, &lProperty); 304 | return lProperty; 305 | } 306 | 307 | long Y() const 308 | { 309 | long lProperty; 310 | m_pInternal->GetProperty(SP_Y, &lProperty); 311 | return lProperty; 312 | } 313 | 314 | long Z() const 315 | { 316 | long lProperty; 317 | m_pInternal->GetProperty(SP_Z, &lProperty); 318 | return lProperty; 319 | } 320 | 321 | long XRaw() const 322 | { 323 | long lProperty; 324 | m_pInternal->GetProperty(SP_XRaw, &lProperty); 325 | return lProperty; 326 | } 327 | 328 | long ZXRaw() const 329 | { 330 | long lProperty; 331 | m_pInternal->GetProperty(SP_ZXRaw, &lProperty); 332 | return lProperty; 333 | } 334 | 335 | long YRaw() const 336 | { 337 | long lProperty; 338 | m_pInternal->GetProperty(SP_YRaw, &lProperty); 339 | return lProperty; 340 | } 341 | 342 | long ZRaw() const 343 | { 344 | long lProperty; 345 | m_pInternal->GetProperty(SP_ZRaw, &lProperty); 346 | return lProperty; 347 | } 348 | 349 | long ZYRaw() const 350 | { 351 | long lProperty; 352 | m_pInternal->GetProperty(SP_ZYRaw, &lProperty); 353 | return lProperty; 354 | } 355 | 356 | long XDelta() const 357 | { 358 | long lProperty; 359 | m_pInternal->GetProperty(SP_XDelta, &lProperty); 360 | return lProperty; 361 | } 362 | 363 | long YDelta() const 364 | { 365 | long lProperty; 366 | m_pInternal->GetProperty(SP_YDelta, &lProperty); 367 | return lProperty; 368 | } 369 | 370 | long ZDelta() const 371 | { 372 | long lProperty; 373 | m_pInternal->GetProperty(SP_ZDelta, &lProperty); 374 | return lProperty; 375 | } 376 | 377 | long XMickeys() const 378 | { 379 | long lProperty; 380 | m_pInternal->GetProperty(SP_XMickeys, &lProperty); 381 | return lProperty; 382 | } 383 | 384 | long YMickeys() const 385 | { 386 | long lProperty; 387 | m_pInternal->GetProperty(SP_YMickeys, &lProperty); 388 | return lProperty; 389 | } 390 | 391 | long ExtendedState() const 392 | { 393 | long lProperty; 394 | m_pInternal->GetProperty(SP_ExtendedState, &lProperty); 395 | return lProperty; 396 | } 397 | 398 | long FingerState() const 399 | { 400 | long lProperty; 401 | m_pInternal->GetProperty(SP_FingerState, &lProperty); 402 | return lProperty; 403 | } 404 | 405 | long ButtonState() const 406 | { 407 | long lProperty; 408 | m_pInternal->GetProperty(SP_ButtonState, &lProperty); 409 | return lProperty; 410 | } 411 | 412 | bool IsLeftButton() const { 413 | return (ButtonState() & SF_ButtonLeft) != 0; 414 | } 415 | 416 | bool IsRightButton() const { 417 | return (ButtonState() & SF_ButtonRight) != 0; 418 | } 419 | 420 | bool IsMiddleButton() const { 421 | return (ButtonState() & SF_ButtonMiddle) != 0; 422 | } 423 | 424 | bool IsTap() const { 425 | return (FingerState() & SF_FingerTap) != 0; 426 | } 427 | 428 | bool IsMotion() const { 429 | return (FingerState() & SF_FingerMotion) != 0; 430 | } 431 | 432 | bool IsFinger() const { 433 | return (FingerState() & SF_FingerPresent) != 0; 434 | } 435 | 436 | bool IsScrollFinger() const { 437 | return (ExtendedState() & SF_StateScrollFinger) != 0; 438 | } 439 | 440 | bool IsAnyFinger() const { 441 | return (IsFinger() || IsScrollFinger()); 442 | } 443 | 444 | bool IsAnyButton() const { 445 | return (!!ButtonState() || !!(FingerState() & SF_FingerAsButton)); 446 | } 447 | }; 448 | 449 | #endif -------------------------------------------------------------------------------- /AbsoluteTouch/InputHelper.cpp: -------------------------------------------------------------------------------- 1 | #include "InputHelper.h" 2 | #include 3 | 4 | void MoveCursor(Point screenPt) 5 | { 6 | INPUT input[1]; 7 | input[0].type = INPUT_MOUSE; 8 | input[0].mi.dx = screenPt.x; 9 | input[0].mi.dy = screenPt.y; 10 | input[0].mi.mouseData = 0; 11 | input[0].mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; 12 | input[0].mi.time = 0; 13 | SendInput(1, input, sizeof(INPUT)); 14 | } 15 | 16 | void SendLeftDown(Point screenPt) 17 | { 18 | INPUT input[2]; 19 | input[0].type = INPUT_MOUSE; 20 | input[0].mi.dx = screenPt.x; 21 | input[0].mi.dy = screenPt.y; 22 | input[0].mi.mouseData = 0; 23 | input[0].mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; 24 | input[0].mi.time = 0; 25 | input[1].type = INPUT_MOUSE; 26 | input[1].mi.dx = 0; 27 | input[1].mi.dy = 0; 28 | input[1].mi.mouseData = 0; 29 | input[1].mi.dwFlags = MOUSEEVENTF_LEFTDOWN; 30 | input[1].mi.time = 0; 31 | SendInput(2, input, sizeof(INPUT)); 32 | } 33 | 34 | void SendLeftUp() 35 | { 36 | INPUT input[1]; 37 | input[0].type = INPUT_MOUSE; 38 | input[0].mi.dx = 0; 39 | input[0].mi.dy = 0; 40 | input[0].mi.mouseData = 0; 41 | input[0].mi.dwFlags = MOUSEEVENTF_LEFTUP; 42 | input[0].mi.time = 0; 43 | SendInput(1, input, sizeof(INPUT)); 44 | } 45 | -------------------------------------------------------------------------------- /AbsoluteTouch/InputHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef INPUT_HELPER_H 2 | #define INPUT_HELPER_H 3 | 4 | #include "Containers.h" 5 | 6 | void MoveCursor(Point screenPt); 7 | void SendLeftDown(Point screenPt); 8 | void SendLeftUp(); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /AbsoluteTouch/TouchProcessor.cpp: -------------------------------------------------------------------------------- 1 | #include "TouchProcessor.h" 2 | 3 | void TouchProcessor::SetWeight(int weight) 4 | { 5 | m_weight = weight; 6 | } 7 | 8 | void TouchProcessor::TouchEnded() 9 | { 10 | m_touching = false; 11 | } 12 | 13 | Point TouchProcessor::Update(Point rawPoint) 14 | { 15 | if (m_weight == 0 || !m_touching) { 16 | m_average = rawPoint; 17 | m_touching = true; 18 | } else { 19 | m_average.x = ((100 - m_weight) * rawPoint.x + m_weight * m_average.x) / 100; 20 | m_average.y = ((100 - m_weight) * rawPoint.y + m_weight * m_average.y) / 100; 21 | } 22 | return m_average; 23 | } 24 | -------------------------------------------------------------------------------- /AbsoluteTouch/TouchProcessor.h: -------------------------------------------------------------------------------- 1 | #ifndef TOUCH_PROCESSOR_H 2 | #define TOUCH_PROCESSOR_H 3 | 4 | #include "Containers.h" 5 | 6 | class TouchProcessor 7 | { 8 | public: 9 | void SetWeight(int weight); 10 | void TouchEnded(); 11 | Point Update(Point rawPoint); 12 | 13 | private: 14 | int m_weight = 0; 15 | bool m_touching = false; 16 | Point m_average; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /AbsoluteTouch/TouchpadManager.cpp: -------------------------------------------------------------------------------- 1 | #include "TouchpadManager.h" 2 | #include 3 | 4 | #define ASSERT_OK(x) do { \ 5 | if ((x) != SYN_OK) \ 6 | assert(false); \ 7 | } while (0) 8 | 9 | TouchpadManager::TouchpadManager() 10 | { 11 | if (CoCreateInstance(__uuidof(SynAPI), nullptr, CLSCTX_INPROC_SERVER, __uuidof(ISynAPI), (void **)&m_api) != S_OK) 12 | throw TouchpadInitException("Could not create SynAPI instance"); 13 | if (m_api->Initialize() != SYN_OK) { 14 | m_api->Release(); 15 | m_api = nullptr; 16 | throw TouchpadInitException("Could not initialize SynAPI (missing kernel drivers?)"); 17 | } 18 | long handle = -1; 19 | if (m_api->FindDevice(SE_ConnectionAny, SE_DeviceTouchPad, &handle) != SYN_OK) { 20 | m_api->Release(); 21 | m_api = nullptr; 22 | throw TouchpadInitException("Could not find any touchpad devices"); 23 | } 24 | ASSERT_OK(m_api->CreateDevice(handle, &m_device)); 25 | ASSERT_OK(m_device->CreatePacket(&m_packet)); 26 | ASSERT_OK(m_device->GetProperty(SP_XLoSensor, &m_bounds.x1)); 27 | ASSERT_OK(m_device->GetProperty(SP_XHiSensor, &m_bounds.x2)); 28 | ASSERT_OK(m_device->GetProperty(SP_YLoSensor, &m_bounds.y1)); 29 | ASSERT_OK(m_device->GetProperty(SP_YHiSensor, &m_bounds.y2)); 30 | } 31 | 32 | bool TouchpadManager::Acquire() 33 | { 34 | if (m_acquired) 35 | return true; 36 | if (m_device->Acquire(0) != SYN_OK) 37 | return false; 38 | m_acquired = true; 39 | return true; 40 | } 41 | 42 | void TouchpadManager::Unacquire() 43 | { 44 | if (!m_acquired) 45 | return; 46 | ASSERT_OK(m_device->Unacquire()); 47 | m_acquired = false; 48 | } 49 | 50 | void TouchpadManager::SetTouchCallback(TouchCallback *callback) 51 | { 52 | if (callback != nullptr && m_callback == nullptr) { 53 | ASSERT_OK(m_device->SetSynchronousNotification(this)); 54 | } else if (callback == nullptr && m_callback != nullptr) { 55 | ASSERT_OK(m_device->SetSynchronousNotification(nullptr)); 56 | } 57 | m_callback = callback; 58 | } 59 | 60 | bool TouchpadManager::IsTouchpadEnabled() 61 | { 62 | HRESULT out; 63 | ASSERT_OK(m_device->GetProperty(SP_DisableState, &out)); 64 | return (out == SYN_FALSE); 65 | } 66 | 67 | void TouchpadManager::SetTouchpadEnabled(bool enabled) 68 | { 69 | ASSERT_OK(m_device->SetProperty(SP_DisableState, enabled ? SYN_FALSE : SYN_TRUE)); 70 | } 71 | 72 | Rect TouchpadManager::GetTouchpadRect() 73 | { 74 | long minX, maxX, minY, maxY; 75 | ASSERT_OK(m_device->GetProperty(SP_XLoBorder, &minX)); 76 | ASSERT_OK(m_device->GetProperty(SP_XHiBorder, &maxX)); 77 | ASSERT_OK(m_device->GetProperty(SP_YLoBorder, &minY)); 78 | ASSERT_OK(m_device->GetProperty(SP_YHiBorder, &maxY)); 79 | Point topLeft = NormalizeCoordinates(minX, maxY); 80 | Point bottomRight = NormalizeCoordinates(maxX, minY); 81 | return Rect(topLeft.x, topLeft.y, bottomRight.x, bottomRight.y); 82 | } 83 | 84 | Point TouchpadManager::NormalizeCoordinates(long x, long y) 85 | { 86 | long nx = x - m_bounds.x1; 87 | long ny = m_bounds.y2 - y; 88 | return Point(nx, ny); 89 | } 90 | 91 | HRESULT STDMETHODCALLTYPE TouchpadManager::OnSynDevicePacket(long seqNum) 92 | { 93 | HRESULT res = m_device->LoadPacket(m_packet); 94 | if (res != SYN_OK && res != SYNE_SEQUENCE) 95 | return res; 96 | if (m_callback == nullptr) 97 | return SYN_OK; 98 | long fingerState; 99 | m_packet->GetProperty(SP_FingerState, &fingerState); 100 | bool touching = (fingerState & SF_FingerPresent) != 0; 101 | if (touching) { 102 | long x, y; 103 | Point point; 104 | m_packet->GetProperty(SP_XRaw, &x); 105 | m_packet->GetProperty(SP_YRaw, &y); 106 | point = NormalizeCoordinates(x, y); 107 | if (m_touching) { 108 | m_callback->OnTouchMoved(point); 109 | } else { 110 | m_callback->OnTouchStarted(point); 111 | m_touching = true; 112 | } 113 | } else if (m_touching) { 114 | m_callback->OnTouchEnded(); 115 | m_touching = false; 116 | } 117 | return SYN_OK; 118 | } 119 | 120 | TouchpadManager::~TouchpadManager() 121 | { 122 | SetTouchCallback(nullptr); 123 | Unacquire(); 124 | m_packet->Release(); 125 | m_device->Release(); 126 | m_api->Release(); 127 | } 128 | -------------------------------------------------------------------------------- /AbsoluteTouch/TouchpadManager.h: -------------------------------------------------------------------------------- 1 | #ifndef TOUCHPAD_MANAGER_H 2 | #define TOUCHPAD_MANAGER_H 3 | 4 | #include "Containers.h" 5 | #include "Include/SynKit.h" 6 | #include 7 | 8 | class TouchpadInitException : public std::runtime_error 9 | { 10 | public: 11 | TouchpadInitException(const char *msg) : std::runtime_error(msg) { } 12 | }; 13 | 14 | class TouchCallback 15 | { 16 | public: 17 | virtual void OnTouchStarted(Point touchPt) = 0; 18 | virtual void OnTouchMoved(Point touchPt) = 0; 19 | virtual void OnTouchEnded() = 0; 20 | }; 21 | 22 | class TouchpadManager : private _ISynDeviceEvents 23 | { 24 | public: 25 | TouchpadManager(); 26 | bool Acquire(); 27 | void Unacquire(); 28 | void SetTouchCallback(TouchCallback *callback); 29 | bool IsTouchpadEnabled(); 30 | void SetTouchpadEnabled(bool enabled); 31 | Rect GetTouchpadRect(); 32 | ~TouchpadManager(); 33 | 34 | private: 35 | Point NormalizeCoordinates(long x, long y); 36 | HRESULT STDMETHODCALLTYPE OnSynDevicePacket(long seqNum) override; 37 | 38 | ISynAPI *m_api = nullptr; 39 | ISynDevice *m_device = nullptr; 40 | ISynPacket *m_packet = nullptr; 41 | TouchCallback *m_callback = nullptr; 42 | Rect m_bounds; 43 | bool m_acquired = false; 44 | bool m_touching = false; 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Andrew Sun (@crossbowffs) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AbsoluteTouch 2 | 3 | Synaptics "absolute mode" emulation in software. Ever wanted to use 4 | your laptop touchpad to play osu!, or to draw your signature? Well, 5 | now you can! 6 | 7 | This project is now deprecated in favor of the new 8 | [AbsoluteTouchEx](https://github.com/apsun/AbsoluteTouchEx) project, 9 | which is compatible with more touchpads and faster. 10 | 11 | ## Requirements 12 | 13 | - A Synaptics touchpad 14 | - Synaptics COM libraries (if you installed the drivers, you probably have this) 15 | 16 | ## Command-line arguments 17 | 18 | | Argument | Description | 19 | |------------------|--------------------------------------------------------------------------------| 20 | | `-t x1,y1,x2,y2` | Sets the mapped touchpad region (0 to 100, 0 = left/top, 100 = right/bottom) | 21 | | `-s x1,y1,x2,y2` | Sets the mapped screen region (see above) | 22 | | `-w weight` | Sets the touch smoothing factor (0 to 100, 0 for no smoothing) | 23 | | `-c` | Enables left clicking by touching the touchpad | 24 | | `-m` | Enables your touchpad when the program starts, and disables it on exit | 25 | 26 | Examples: 27 | - `-w 50 -t 50,0,100,100` apply 50% touch smoothing and only use the right 28 | half of the touchpad. 29 | - `-t 50,0,100,50 -s 50,0,100,50` make the top-right quarter of the 30 | touchpad map to the top-right quarter of the screen. 31 | 32 | ## License 33 | 34 | Distributed under the [MIT License](http://opensource.org/licenses/MIT). 35 | --------------------------------------------------------------------------------