Skip to content

Commit

Permalink
Update v1.2.0
Browse files Browse the repository at this point in the history
- Add support for non-wacom tablets
- Refactor code
- Fix passing tablet name in extension
  • Loading branch information
Agamnentzar committed Sep 21, 2020
1 parent 46c2c2f commit 182c58c
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 167 deletions.
4 changes: 2 additions & 2 deletions extension/background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var nativeInstallUrl = 'https://github.com/Agamnentzar/chrome-stylus-pressure/releases/download/1.1.0/StylusPressurePlugin.msi';
var latestNativePluginVersion = '1.1.0';
var nativeInstallUrl = 'https://github.com/Agamnentzar/chrome-stylus-pressure/releases/download/1.2.0/StylusPressurePlugin.msi';
var latestNativePluginVersion = '1.2.0';
var minimumNativePluginVersion = '1.0.0';
var nativePort = null;
var popupMessage = 'ok';
Expand Down
2 changes: 1 addition & 1 deletion extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function main(window, runtimeId) {

port.onMessage.addListener(function (msg) {
if (typeof msg.name !== 'undefined') {
pen.name = name;
pen.name = msg.name;
}

if (typeof msg.p !== 'undefined') {
Expand Down
1 change: 1 addition & 0 deletions windows/Plugin/ListingDevicesNative.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
Expand Down
21 changes: 6 additions & 15 deletions windows/Plugin/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,14 @@ void UnloadWintab(void)
}

// Display error to user.
void ShowError(char *pszErrorMessage)
{
void ShowError(char *pszErrorMessage) {
WACOM_TRACE("ShowError()\n");
WACOM_ASSERT(pszErrorMessage);
WACOM_TRACE(pszErrorMessage);
}

#ifdef WACOM_DEBUG

void WacomTrace(char *lpszFormat, ...)
{
void WacomTrace(char *lpszFormat, ...) {
char szTraceMessage[128];

int nBytesWritten;
Expand All @@ -126,18 +123,12 @@ void WacomTrace(char *lpszFormat, ...)

va_start(args, lpszFormat);

nBytesWritten = _vsnprintf(szTraceMessage, sizeof(szTraceMessage) - 1,
lpszFormat, args);
nBytesWritten = _vsnprintf(szTraceMessage, sizeof(szTraceMessage) - 1, lpszFormat, args);

if (nBytesWritten > 0)
{
char szHeader[128];
sprintf(szHeader, "[%s]: ", "test");
OutputDebugStringA(szHeader);
OutputDebugStringA(szTraceMessage);
if (nBytesWritten > 0) {
printf("[test] %s", szTraceMessage);
}

va_end(args);
}

#endif // WACOM_DEBUG
#endif
5 changes: 2 additions & 3 deletions windows/Plugin/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

#include "wintab.h" // NOTE: get from wactab header package


//////////////////////////////////////////////////////////////////////////////
#ifdef DEBUG
#define WACOM_DEBUG
#endif

// Ignore warnings about using unsafe string functions.
#pragma warning( disable : 4996 )
Expand Down Expand Up @@ -84,4 +84,3 @@ void WacomTrace(char *lpszFormat, ...);
#define WACOM_ASSERT( x )

#endif // WACOM_DEBUG

Loading

0 comments on commit 182c58c

Please sign in to comment.