include/berkelium/Cursor.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _BERKELIUM_CURSOR_HPP_
00034 #define _BERKELIUM_CURSOR_HPP_
00035
00036 #include "berkelium/Platform.hpp"
00037
00038 #if BERKELIUM_PLATFORM == PLATFORM_WINDOWS
00039 #include <windows.h>
00040 #elif BERKELIUM_PLATFORM == PLATFORM_LINUX
00041
00042
00043
00044 typedef int GdkCursorEnum;
00045 #define GDK_CURSOR_TYPE_FROM_ENUM(X) ((GdkCursorType)X)
00046 typedef void* GdkCursorPtr;
00047 #define GDK_CURSOR_FROM_PTR(X) ((GdkCursor*)X)
00048 #elif BERKELIUM_PLATFORM == PLATFORM_MAC
00049 #ifdef __OBJC__
00050 @class NSCursor;
00051 #else
00052 class NSCursor;
00053 #endif
00054 #endif
00055
00056 namespace Berkelium {
00057
00058 class WindowImpl;
00059
00065 class BERKELIUM_EXPORT Cursor {
00066 public:
00067 #if BERKELIUM_PLATFORM == PLATFORM_WINDOWS
00068 HCURSOR GetCursor() const;
00069 #elif BERKELIUM_PLATFORM == PLATFORM_LINUX
00070 GdkCursorEnum GetCursorType() const;
00071 GdkCursorPtr GetCustomCursor() const;
00072 #elif BERKELIUM_PLATFORM == PLATFORM_MAC
00073 NSCursor* GetCursor() const;
00074 #endif
00075
00076 private:
00077 friend class WindowImpl;
00078
00079 Cursor();
00080
00081 #if BERKELIUM_PLATFORM == PLATFORM_WINDOWS
00082 Cursor(const HCURSOR handle);
00083
00084 HCURSOR mHandle;
00085 #elif BERKELIUM_PLATFORM == PLATFORM_LINUX
00086 Cursor(const GdkCursorEnum& _type, GdkCursorPtr _cursor);
00087
00088 GdkCursorEnum mType;
00089 GdkCursorPtr mCursor;
00090 #elif BERKELIUM_PLATFORM == PLATFORM_MAC
00091 Cursor(NSCursor* _cursor);
00092
00093 NSCursor* mCursor;
00094 #endif
00095 };
00096
00097 }
00098
00099 #endif //_BERKELIUM_CURSOR_HPP_