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)
26 #ifdef OCEAN_COMPILER_MSC
54 static void textOutput(HDC dc,
const int x,
const int y,
const std::string& text);
82 static void frameOutput(HDC dc,
const int x,
const int y,
const unsigned int width,
const unsigned int height,
const Frame& frame);
107 static inline void desktopFrameOutput(
const int x,
const int y,
const unsigned int scale,
const Frame& frame);
121 static void desktopFrameOutput(
const int x,
const int y,
const unsigned int width,
const unsigned int height,
const Frame& frame);
139 static inline void desktopBitmapOutput(
const int x,
const int y,
const unsigned int scale,
const Bitmap& bitmap);
150 static void bitmapOutput(HDC dc,
const int x,
const int y,
const unsigned int width,
const unsigned int height,
const Bitmap& bitmap);
230 inline bool increase(
const HWND windowHandle);
236 inline bool decrease(
const HWND windowHandle);
242 inline bool isZero(
const HWND windowHandle);
297 #if defined(OCEAN_COMPILER_MSC) && defined(_MANAGED)
299 inline System::String^
toString(
const std::string& value)
301 return gcnew System::String(value.c_str());
306 return gcnew System::String(value);
309 inline System::String^
toString(
const std::wstring& value)
311 return gcnew System::String(value.c_str());
314 inline System::String^
toString(
const wchar_t* value)
316 return gcnew System::String(value);
321 char* str = (
char*)(
void*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(value);
322 std::string result(str);
324 System::Runtime::InteropServices::Marshal::FreeHGlobal(System::IntPtr(str));
331 char* str = (
char*)(
void*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(value);
332 std::string result(str);
334 System::Runtime::InteropServices::Marshal::FreeHGlobal(System::IntPtr(str));
360 for (CounterMap::const_iterator it = counterMap_.begin(); it != counterMap_.end(); ++it)
361 ocean_assert(it->second == 0u);
368 counterMap_[windowHandle]++;
370 return counterMap_[windowHandle] == 1u;
375 ocean_assert(counterMap_.find(windowHandle) != counterMap_.end());
376 ocean_assert(counterMap_[windowHandle] >= 1u);
378 counterMap_[windowHandle]--;
380 return counterMap_[windowHandle] == 0u;
385 return counterMap_[windowHandle] == 0u;
This class implements Ocean's image class.
Definition: Frame.h:1792
unsigned int width() const
Returns the width of the frame format in pixel.
Definition: Frame.h:3143
unsigned int height() const
Returns the height of the frame in pixel.
Definition: Frame.h:3148
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