8#ifndef META_OCEAN_PLATFORM_WIN_UTILITIES_H
9#define META_OCEAN_PLATFORM_WIN_UTILITIES_H
18#ifdef OCEAN_COMPILER_MSC
19 #pragma managed(push, off)
24#ifdef OCEAN_COMPILER_MSC
71 static void textOutput(HDC dc,
const int x,
const int y,
const std::string& text);
92 static void textOutput(HDC deviceContext,
const std::wstring& text,
const std::wstring& font,
const unsigned int fontSize,
const bool bold,
const AnchorPosition anchorPosition,
const unsigned int windowWidth,
const unsigned int windowHeight,
const int32_t foregroundColor,
const int32_t backgroundColor = -1,
const int32_t shadowColor = -1,
const unsigned int shadowOffsetX = 2u,
const unsigned int shadowOffsetY = 2u,
const unsigned int marginX = 20u,
const unsigned int marginY = 20u);
120 static void frameOutput(HDC dc,
const int x,
const int y,
const unsigned int width,
const unsigned int height,
const Frame& frame);
145 static inline void desktopFrameOutput(
const int x,
const int y,
const unsigned int scale,
const Frame& frame);
159 static void desktopFrameOutput(
const int x,
const int y,
const unsigned int width,
const unsigned int height,
const Frame& frame);
177 static inline void desktopBitmapOutput(
const int x,
const int y,
const unsigned int scale,
const Bitmap& bitmap);
188 static void bitmapOutput(HDC dc,
const int x,
const int y,
const unsigned int width,
const unsigned int height,
const Bitmap& bitmap);
268 inline bool increase(
const HWND windowHandle);
274 inline bool decrease(
const HWND windowHandle);
280 inline bool isZero(
const HWND windowHandle);
335#if defined(OCEAN_COMPILER_MSC) && defined(_MANAGED)
337inline System::String^
toString(
const std::string& value)
339 return gcnew System::String(value.c_str());
344 return gcnew System::String(value);
347inline System::String^
toString(
const std::wstring& value)
349 return gcnew System::String(value.c_str());
352inline System::String^
toString(
const wchar_t* value)
354 return gcnew System::String(value);
359 char* str = (
char*)(
void*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(value);
360 std::string result(str);
362 System::Runtime::InteropServices::Marshal::FreeHGlobal(System::IntPtr(str));
369 char* str = (
char*)(
void*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(value);
370 std::string result(str);
372 System::Runtime::InteropServices::Marshal::FreeHGlobal(System::IntPtr(str));
398 for (CounterMap::value_type& counterPair : counterMap_)
400 ocean_assert(counterPair.second == 0u);
408 counterMap_[windowHandle]++;
410 return counterMap_[windowHandle] == 1u;
415 ocean_assert(counterMap_.find(windowHandle) != counterMap_.end());
416 ocean_assert(counterMap_[windowHandle] >= 1u);
418 counterMap_[windowHandle]--;
420 return counterMap_[windowHandle] == 0u;
425 return counterMap_[windowHandle] == 0u;
This class implements Ocean's image class.
Definition Frame.h:1879
unsigned int width() const
Returns the width of the frame format in pixel.
Definition Frame.h:3241
unsigned int height() const
Returns the height of the frame in pixel.
Definition Frame.h:3246
This class implements a recursive lock object.
Definition Lock.h:31
This template class is the base class for all singleton objects.
Definition Singleton.h:71
static std::wstring toWString(const char value)
Converts a value to a wstring.
The namespace covering the entire Ocean framework.
Definition Accessor.h:15