Fix indentation back to 4

This commit is contained in:
2022-11-08 19:18:18 +01:00
parent cc2316a497
commit 0081d219f9
11 changed files with 68 additions and 66 deletions

View File

@@ -5,7 +5,7 @@
namespace ptprnt::bitmap {
struct Bitmap {
std::vector<std::vector<int>> map;
std::vector<std::vector<int>> map;
};
} // namespace ptprnt::bitmap

View File

@@ -5,8 +5,8 @@
namespace ptprnt::driver {
struct info {
std::string name{""};
std::string version{""};
std::string name{""};
std::string version{""};
};
} // namespace ptprnt::driver

View File

@@ -6,39 +6,39 @@
namespace ptprnt::driver {
class IDriver {
public:
virtual ~IDriver(){};
public:
virtual ~IDriver(){};
/**
/**
* @brief Get Information struct about this driver
*
* @return driver::info
*/
virtual driver::info getInfo() = 0;
virtual driver::info getInfo() = 0;
/**
/**
* @brief opens up the device specified
*
* @return true successfully open up device
* @return false failed to open device
*/
virtual bool open() = 0;
virtual bool open() = 0;
/**
/**
* @brief close the device
*
* @return true successfully closed device
* @return false failed to close device
*/
virtual bool close() = 0;
virtual bool close() = 0;
/**
/**
* @brief Send a command to device
*
* @return true successfully sent command to device
* @return false error sending command
*/
virtual bool command() = 0;
virtual bool command() = 0;
};
} // namespace ptprnt::driver

View File

@@ -10,17 +10,17 @@
namespace ptprnt::printer {
class IPrinter {
public:
virtual ~IPrinter(){};
public:
virtual ~IPrinter(){};
/**
/**
* @brief Get Information struct about the printer
*
* @return driver::info
*/
virtual printer::info getInfo() = 0;
virtual printer::info getInfo() = 0;
/**
/**
* @brief Prints text immediatly
*
* @param text Text to print
@@ -28,16 +28,16 @@ class IPrinter {
* @return true Printing succeeded
* @return false Printing failed
*/
virtual bool printText(std::string_view text, uint32_t fontSize) = 0;
virtual bool printText(std::string_view text, uint32_t fontSize) = 0;
/**
/**
* @brief Prints supplied bitmap immediatly
*
* @param bm Bitmap to print
* @return true Printing succeeded
* @return false Printing failed
*/
virtual bool printBitmap(std::shared_ptr<bitmap::Bitmap> bm) = 0;
virtual bool printBitmap(std::shared_ptr<bitmap::Bitmap> bm) = 0;
};
} // namespace ptprnt::printer

View File

@@ -9,14 +9,14 @@
namespace ptprnt::driver {
class P700Driver : public IDriver {
public:
P700Driver(uint16_t UsbDevVendor = 0x04f9, uint16_t UsbDevId = 0x2061);
~P700Driver() override;
public:
P700Driver(uint16_t UsbDevVendor = 0x04f9, uint16_t UsbDevId = 0x2061);
~P700Driver() override;
driver::info getInfo() override;
bool open() override;
bool close() override;
bool command() override;
driver::info getInfo() override;
bool open() override;
bool close() override;
bool command() override;
};
} // namespace ptprnt::driver

View File

@@ -9,17 +9,17 @@
namespace ptprnt::printer {
class P700Printer : public IPrinter {
public:
P700Printer(std::unique_ptr<driver::P700Driver> driver);
~P700Printer() override;
public:
P700Printer(std::unique_ptr<driver::P700Driver> driver);
~P700Printer() override;
printer::info getInfo() override;
bool printText(std::string_view text, uint32_t fontSize) override;
bool printBitmap(std::shared_ptr<bitmap::Bitmap> bm) override;
printer::info getInfo() override;
bool printText(std::string_view text, uint32_t fontSize) override;
bool printBitmap(std::shared_ptr<bitmap::Bitmap> bm) override;
private:
static info mPrinterInfo;
std::unique_ptr<driver::P700Driver> mDriver;
private:
static info mPrinterInfo;
std::unique_ptr<driver::P700Driver> mDriver;
};
} // namespace ptprnt::printer

View File

@@ -5,17 +5,17 @@
namespace ptprnt::printer {
enum class colorMode {
monochrome = 0,
color = 0,
monochrome = 0,
color = 0,
};
struct info {
std::string name{""};
std::string revision{""};
uint32_t xres = {0};
uint32_t yres = {0};
colorMode color = {colorMode::monochrome};
bool cutter = {false};
std::string name{""};
std::string revision{""};
uint32_t xres = {0};
uint32_t yres = {0};
colorMode color = {colorMode::monochrome};
bool cutter = {false};
};
} // namespace ptprnt::printer