#ifndef _AUTOCAPTURE_H_
#define _AUTOCAPTURE_H_
+#include "wx/beforestd.h"
#include <vector>
-#include "wx/filename.h"
+#include "wx/afterstd.h"
+#include "wx/gdicmn.h"
+
+class wxBitmap;
+class wxFlexGridSizer;
+class wxWindow;
class wxNotebook;
/**
*/
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.
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));
}
*/
void RegisterControl(wxWindow * ctrl, int flag)
{
- RegisterControl(ctrl, _T(""), flag);
+ RegisterControl(ctrl, wxT(""), flag);
}
/**
*/
void RegisterPageTurn()
{
- m_controlList.push_back(Control(0, _T(""), AJ_TurnPage));
+ m_controlList.push_back(Control(0, wxT(""), AJ_TurnPage));
}
/**
/**
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.
/*
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
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.