Remove src/pen directory

It's not required anymore after 1c94dda072
This commit is contained in:
David Capello 2016-04-27 12:47:55 -03:00
parent 93fff6a738
commit 0c9fb6b22b
6 changed files with 1 additions and 149 deletions

View File

@ -29,13 +29,12 @@ because they don't depend on any other component.
* [gen](gen/) (base): Helper utility to generate C++ files from different XMLs.
* [gfx](gfx/) (fixmath): Abstract graphics structures like point, size, rectangle, region, color, etc.
* [net](net/) (base): Networking library to send HTTP requests.
* [pen](pen/) (base, wacom): Library to handle graphics tablet input.
* [webserver](webserver/) (base): HTTP web server
## Level 2
* [doc](doc/) (base, fixmath, gfx): Document model library.
* [she](she/) (allegro, base, gfx): A wrapper for the Allegro library.
* [she](she/) (allegro, base, gfx, wacom): A wrapper for the Allegro library.
## Level 3

View File

@ -1,8 +0,0 @@
# Aseprite Pen Library
# Copyright (C) 2016 David Capello
add_library(pen-lib
pen.cpp)
target_link_libraries(pen-lib
base-lib)

View File

@ -1,31 +0,0 @@
// Aseprite Pen Library
// Copyright (c) 2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "pen/pen.h"
#ifdef _WIN32
#include "pen/pen_win.h"
#else
#include "pen/pen_none.h"
#endif
namespace pen {
PenAPI::PenAPI(void* nativeDisplayHandle)
: m_impl(new Impl(nativeDisplayHandle))
{
}
PenAPI::~PenAPI()
{
delete m_impl;
}
} // namespace pen

View File

@ -1,25 +0,0 @@
// Aseprite Pen Library
// Copyright (c) 2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef PEN_PEN_H_INCLUDED
#define PEN_PEN_H_INCLUDED
#pragma once
namespace pen {
class PenAPI {
public:
PenAPI(void* nativeDisplayHandle);
~PenAPI();
private:
class Impl;
Impl* m_impl;
};
} // namespace pen
#endif

View File

@ -1,15 +0,0 @@
// Aseprite Pen Library
// Copyright (c) 2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
namespace pen {
class PenAPI::Impl {
public:
Impl(void*) { }
~Impl() { }
};
} // namespace pen

View File

@ -1,68 +0,0 @@
// Aseprite Pen Library
// Copyright (c) 2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#include "base/debug.h"
#include "base/dll.h"
#include "base/fs.h"
#include "base/log.h"
#include "base/path.h"
#include "base/string.h"
#include <windows.h>
#include "wacom/wintab.h"
typedef UINT (API* WTInfoW_Func)(UINT, UINT, LPVOID);
typedef HCTX (API* WTOpenW_Func)(HWND, LPLOGCONTEXTW, BOOL);
typedef BOOL (API* WTClose_Func)(HCTX);
class pen::PenAPI::Impl {
public:
Impl(void* nativeDisplayHandle) : m_ctx(nullptr) {
m_wintabLib = base::load_dll("wintab32.dll");
if (!m_wintabLib)
return;
auto WTInfoW = base::get_dll_proc<WTInfoW_Func>(m_wintabLib, "WTInfoW");
auto WTOpenW = base::get_dll_proc<WTOpenW_Func>(m_wintabLib, "WTOpenW");
if (!WTInfoW || !WTOpenW)
return;
LOGCONTEXTW logctx;
memset(&logctx, 0, sizeof(LOGCONTEXTW));
logctx.lcOptions |= CXO_SYSTEM;
UINT infoRes = WTInfoW(WTI_DEFSYSCTX, 0, &logctx);
ASSERT(infoRes == sizeof(LOGCONTEXTW));
ASSERT(logctx.lcOptions & CXO_SYSTEM);
logctx.lcOptions |= CXO_SYSTEM;
m_ctx = WTOpenW((HWND)nativeDisplayHandle, &logctx, TRUE);
if (!m_ctx) {
LOG("Pen library is not initialized...\n");
return;
}
LOG("Pen initialized...\n");
}
~Impl() {
if (!m_wintabLib)
return;
if (m_ctx) {
auto WTClose = base::get_dll_proc<WTClose_Func>(m_wintabLib, "WTClose");
if (WTClose) {
LOG("Pen shutdown...\n");
WTClose(m_ctx);
}
}
base::unload_dll(m_wintabLib);
}
private:
base::dll m_wintabLib;
HCTX m_ctx;
};