Gwork: 0.3.0Dev
Gwk::Platform Namespace Reference

Classes

class  RelativeToExecutablePaths
 

Functions

GWK_EXPORT void Sleep (unsigned int ms)
 
GWK_EXPORT float GetTimeInSeconds ()
 
GWK_EXPORT String GetExecutableDir ()
 
GWK_EXPORT void SetCursor (unsigned char cursor)
 
GWK_EXPORT void GetCursorPos (Gwk::Point &p)
 
GWK_EXPORT void GetDesktopSize (int &w, int &h)
 
GWK_EXPORT String GetClipboardText ()
 Get platform clipboard as a string.
 
GWK_EXPORT bool SetClipboardText (const String &str)
 Set platform clipboard from a string.
 
GWK_EXPORT bool FileOpen (const String &Name, const String &StartPath, const String &Extension, String &filePathOut)
 
GWK_EXPORT bool FileSave (const String &Name, const String &StartPath, const String &Extension, String &filePathOut)
 
GWK_EXPORT bool FolderOpen (const String &Name, const String &StartPath, String &filePathOut)
 
GWK_EXPORT void * CreatePlatformWindow (int x, int y, int w, int h, const Gwk::String &windowTitle)
 
GWK_EXPORT void DestroyPlatformWindow (void *ptr)
 
GWK_EXPORT void SetBoundsPlatformWindow (void *ptr, int x, int y, int w, int h)
 
GWK_EXPORT bool MessagePump (void *window)
 
GWK_EXPORT bool IsFocussedPlatformWindow (void *ptr)
 
GWK_EXPORT void SetWindowMaximized (void *ptr, bool bMaximized, Gwk::Point &newPos, Gwk::Point &newSize)
 
GWK_EXPORT void SetWindowMinimized (void *ptr, bool bMinimized)
 
GWK_EXPORT void SetPlatformWindow (void *handle)
 If the user created the window, notify the plaform so it can do its housekeeping.
 
void DefaultLogListener (Gwk::Log::Level lvl, const char *message)
 

Detailed Description

The platform abstraction layer. Each platform implements these functions in their own specific way.

Function Documentation

◆ GetExecutableDir()

GWK_EXPORT String Gwk::Platform::GetExecutableDir ( )

Get the directory of the running executable.

Returns
Path string, blank if not known.
Note
Path is terminated with directory separator.

◆ SetCursor()

GWK_EXPORT void Gwk::Platform::SetCursor ( unsigned char  cursor)

Set the system cursor.

Parameters
cursor: Cursor number to use.
See also
CursorType

◆ Sleep()

GWK_EXPORT void Gwk::Platform::Sleep ( unsigned int  ms)

Go to sleep for a time. Stops CPU hogging.

Parameters
ms: Number of milliseconds to sleep for.