add undocumented option: --dpi v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Thu, 28 Dec 2023 00:37:59 +0100
branchv_0
changeset 35 dcb2ad86e23c
parent 34 7ea796b00538
child 36 0ffb35999bb0
add undocumented option: --dpi
CLIParser.h
--- a/CLIParser.h	Thu Dec 28 00:32:23 2023 +0100
+++ b/CLIParser.h	Thu Dec 28 00:37:59 2023 +0100
@@ -29,6 +29,7 @@
 	static const std::string OPTION_SHADER;
 	static const std::string OPTION_BACKGROUND_COLOR;
 	static const std::string OPTION_ROOT_WINDOW;
+	static const std::string OPTION_DPI;
 
 	const std::string
 	readNext(const std::vector<std::string>& arguments, int& i) {
@@ -73,6 +74,11 @@
 				Configuration::Document document;
 				document.fileName = readNext(arguments, i);
 				c.documents.push_back(document);
+			} else if (option == OPTION_DPI) {
+				// intentionally not documented
+				// will be probably replaced with absolute resolution
+				// or removed (dynamic rendering accorging to the zoom level)
+				c.dpi = std::stod(readNext(arguments, i));
 			} else if (option == OPTION_SHADER) {
 				const auto type = readNext(arguments, i);
 				const auto file = readNext(arguments, i);
@@ -92,3 +98,4 @@
 const std::string CLIParser::OPTION_SHADER = "--shader";
 const std::string CLIParser::OPTION_BACKGROUND_COLOR = "--background-color";
 const std::string CLIParser::OPTION_ROOT_WINDOW = "--root-window";
+const std::string CLIParser::OPTION_DPI = "--dpi";