X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8da17c8609ea5f904b48cd60e92ab0725208cdcf..e2758e21753c00b8e36f11c003fd6cd0e5137391:/utils/screenshotgen/src/autocapture.h diff --git a/utils/screenshotgen/src/autocapture.h b/utils/screenshotgen/src/autocapture.h index 3db8cbc8b9..20f16415e5 100644 --- a/utils/screenshotgen/src/autocapture.h +++ b/utils/screenshotgen/src/autocapture.h @@ -9,9 +9,15 @@ #ifndef _AUTOCAPTURE_H_ #define _AUTOCAPTURE_H_ +#include "wx/beforestd.h" #include -#include "wx/filename.h" +#include "wx/afterstd.h" +#include "wx/gdicmn.h" + +class wxBitmap; +class wxFlexGridSizer; +class wxWindow; class wxNotebook; /** @@ -210,11 +216,9 @@ public: */ AutoCaptureMechanism(wxNotebook *notebook, int flag = AJ_NormalAll, - int margin = 5) - : m_notebook(notebook), m_flag(flag), - m_margin(margin), m_grid(NULL) {} + int margin = 5); - ~AutoCaptureMechanism(){} + ~AutoCaptureMechanism() { } /** Register a control and perform specifid auto adjustments. @@ -238,7 +242,7 @@ public: Please read the document of enum AdjustFlags, and notice that this flag could be enabled/ disabled by global flag GlobalAdjustFlags. */ - void RegisterControl(wxWindow * ctrl, wxString name = _T(""), int flag = AJ_Normal) + void RegisterControl(wxWindow * ctrl, wxString name = wxT(""), int flag = AJ_Normal) { m_controlList.push_back(Control(ctrl, name, flag)); } @@ -252,7 +256,7 @@ public: */ void RegisterControl(wxWindow * ctrl, int flag) { - RegisterControl(ctrl, _T(""), flag); + RegisterControl(ctrl, wxT(""), flag); } /** @@ -263,7 +267,7 @@ public: */ void RegisterPageTurn() { - m_controlList.push_back(Control(0, _T(""), AJ_TurnPage)); + m_controlList.push_back(Control(0, wxT(""), AJ_TurnPage)); } /** @@ -277,31 +281,34 @@ public: /** Take a screenshot for the given region. - @param rect is the given rectangular region. - - @param delay is only useful for Mac, for fixing a delay bug. It seems that it didn't - fix the bug, so it might be removed soon. + @param bitmap + Bitmap to save the screenshot to. + @param rect + Given rectangular region. + @param delay + Only useful for Mac, for fixing a delay bug. It seems that it + didn't fix the bug, so it might be removed soon. */ - static wxBitmap Capture(wxRect rect, int delay = 0); + static bool Capture(wxBitmap* bitmap, wxRect rect, int delay = 0); /** Take a screenshot for the given region. - @see Capture(wxRect rect, int delay) + @see Capture(wxBitmap*,wxRect,int) */ - static wxBitmap Capture(int x, int y, int width, int height, int delay = 0); + static bool Capture(wxBitmap* bitmap, int x, int y, int width, int height, int delay = 0); /** Save the screenshot as the name of @a fileName in the default directory. @a fileName should be without ".png". */ - static void Save(wxBitmap screenshot, wxString fileName); + static void Save(wxBitmap* screenshot, const wxString& fileName); /** Set the default directory where the screenshots will be generated. */ - static void SetDefaultDirectory(wxString dir) { default_dir = dir; } + static void SetDefaultDirectory(const wxString& dir) { default_dir = dir; } /** Get the default directory where the screenshots will be generated. @@ -344,7 +351,7 @@ private: /* Capture and auto adjust the control. Used by CaptureAll(). */ - wxBitmap Capture(Control & ctrl); + bool Capture(wxBitmap* bitmap, Control& ctrl); /* Get the correct rectangular region that the control occupies. Used by @@ -384,7 +391,7 @@ private: The gap is 20 pixels by default. Currently it isn't configurable. */ - static wxBitmap Union(wxBitmap pic1, wxBitmap pic2); + static bool Union(wxBitmap* top, wxBitmap* bottom, wxBitmap* result); /* Delay a few seconds without blocking GUI.