From 0a69e6019547f762719db1fcbe67163d5d7af115 Mon Sep 17 00:00:00 2001 From: Tobias Baumann Date: Thu, 10 Feb 2022 17:55:34 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=9Eutils.h=E2=80=9C=20l=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils.h | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 utils.h diff --git a/utils.h b/utils.h deleted file mode 100644 index 21377fc..0000000 --- a/utils.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include -#include -#include - -//--------------------------------------------------------------------------------------------------- -/// Initializes the color of the GDK. with old compiler as vs2013 we can't initialize structure easily..... -/// For allocated colors, the pixel value used to draw this color on the screen.Not used anymore. -/// The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensity. -/// The green component of the color. -/// The blue component of the color. -/// The initialized color ( -inline GdkColor InitGDKColor(const guint32 pixel = 0, const guint16 r = 0, const guint16 g = 0, const guint16 b = 0) -{ - GdkColor c; - c.pixel = pixel; - c.red = r; - c.green = g; - c.blue = b; - return c; -} -//--------------------------------------------------------------------------------------------------- - -//--------------------------------------------------------------------------------------------------- -class CGdkcolorAutoCast -{ -public: - CGdkcolorAutoCast(const OpenViBE::Kernel::IBox& box, OpenViBE::Kernel::IConfigurationManager& configManager, const size_t index) - : m_configManager(configManager) - { - box.getSettingValue(index, m_settingValue); - m_settingValue = m_configManager.expand(m_settingValue); - } - - operator GdkColor() const - { - std::stringstream ss(m_settingValue.toASCIIString()); - int r = 0, g = 0, b = 0; - char c; - ss >> r >> c >> g >> c >> b; - return InitGDKColor(0, guint16(r * 655.35), guint16(g * 655.35), guint16(b * 655.35)); - } - -protected: - OpenViBE::Kernel::IConfigurationManager& m_configManager; - OpenViBE::CString m_settingValue; -}; - -//---------------------------------------------------------------------------------------------------