00001 #ifndef __CWindowTools__
00002 #define __CWindowTools__
00003
00004 #include <Basics/CString.hpp>
00005 #include <MathTools/CRect.hpp>
00006 #include <MathTools/CPoint.hpp>
00007 #include <MathTools/CDimension.hpp>
00008 #include "SWindowHandle.hpp"
00009
00010
00011
00012 using Exponent::Basics::CString;
00013 using Exponent::MathTools::CRect;
00014 using Exponent::MathTools::CPoint;
00015 using Exponent::MathTools::CDimension;
00016 using Exponent::GUI::Windowing::SWindowHandle;
00017
00018
00019
00020 namespace Exponent
00021 {
00022 namespace GUI
00023 {
00024 namespace Windowing
00025 {
00043 class CWindowTools
00044 {
00045 public:
00046
00051 static void getDesktopWindow(SWindowHandle *handle);
00052
00057 static void getForeGroundWindow(SWindowHandle *handle);
00058
00063 static void setForeGroundWindow(SWindowHandle *windowHandle);
00064
00069 static void setFocusWindow(SWindowHandle *windowHandle);
00070
00076 static void getWindowFromPoint(SWindowHandle *handle, const CPoint &point);
00077
00083 static bool isWindowVisible(SWindowHandle *windowHandle);
00084
00089 static void getMousePosition(CPoint &point);
00090
00095 static void setMousePosition(const CPoint &point);
00096
00105 static bool computeStringArea(
00106 #ifndef WIN32
00107 const
00108 #endif
00109 void *drawContext, const CString &string, CDimension &dimension, void *winFont = NULL);
00110
00111 #ifdef WIN32
00112
00122 static bool computeStringAreaNoGDIPlusStartup(HDC drawContext, const CString &string, CDimension &dimension, HFONT font);
00123 #endif
00124
00131 static bool getWindowArea(SWindowHandle *windowHandle, CRect &areaToFill);
00132
00139 static bool getContentArea(SWindowHandle *windowHandle, CDimension &dimension);
00140
00151 static bool computeCorrectedWindowArea(const CDimension &dimension, CDimension &dimensionToFill, unsigned long style, unsigned long exStyle = -1, const bool hasMenu = false);
00152
00159 static bool getGlobalContentAreaCoordinates(SWindowHandle *windowHandle, CRect &areaToFill);
00160
00166 static long computeLogicalSizeFromPointSize(const long pointSize);
00167
00168 #ifndef WIN32
00169
00174 static bool isWindowComposited(SWindowHandle *windowHandle);
00175 #endif
00176 };
00177 }
00178 }
00179 }
00180 #endif // End of CWindowTools.hpp