Permalink
Browse files

Add doxygen comment.

  • Loading branch information...
1 parent 98fe901 commit 61b3a1819a522fcc4ed06d9a29830e21174a0c5f @legnaleurc committed May 12, 2012
Showing with 63 additions and 0 deletions.
  1. +28 −0 src/widget/focusgrabberstrategy.cpp
  2. +35 −0 src/widget/qsnapshotstrategy.cpp
@@ -20,25 +20,53 @@
using qsnapshot::widget::FocusGrabber;
+/**
+ * @class qsnapshot::widget::FocusGrabber::Strategy
+ * @brief Strategy of each window system for qsnapshot::widget::FocusGrabber.
+ */
+
+/**
+ * @brief Current Strategy instance creator.
+ * @return A creator functor. May be nullptr.
+ * @todo return a smart pointer
+ *
+ * If the functor is nullptr, createInstance will use default Strategy.
+ */
std::function< FocusGrabber::Strategy * ( FocusGrabber * ) > & FocusGrabber::Strategy::creator() {
static std::function< Strategy * ( FocusGrabber * ) > f = nullptr;
return f;
}
+/**
+ * @brief Creates Strategy instance.
+ * @return Strategy instance
+ */
FocusGrabber::Strategy * FocusGrabber::Strategy::createInstance( FocusGrabber * host ) {
if( Strategy::creator() == nullptr ) {
return new Strategy( host );
}
return Strategy::creator()( host );
}
+/**
+ * @brief Constructor.
+ * @param host The strategy host
+ */
FocusGrabber::Strategy::Strategy( FocusGrabber * host ):
host( host ) {
}
+/**
+ * @brief Destructor.
+ */
FocusGrabber::Strategy::~Strategy() {
}
+/**
+ * @brief Post-initialization for FocusGrabber.
+ *
+ * This function will call by FocusGrabber's constructor.
+ */
void FocusGrabber::Strategy::postNew() {
// except X11, somehow opacity == 0.0 will block events
this->host->setWindowOpacity( 0.1 );
@@ -20,29 +20,64 @@
using qsnapshot::widget::QSnapshot;
+/**
+ * @class qsnapshot::widget::QSnapshot::Strategy
+ * @brief Strategy of each window system for qsnapshot::widget::QSnapshot.
+ */
+
+/**
+ * @brief Current Strategy instance creator.
+ * @return A creator functor. May be nullptr.
+ * @todo return a smart pointer
+ *
+ * If the functor is nullptr, createInstance will use default Strategy.
+ */
std::function< QSnapshot::Strategy * ( QSnapshot * ) > & QSnapshot::Strategy::creator() {
static std::function< Strategy * ( QSnapshot * ) > f = nullptr;
return f;
}
+/**
+ * @brief Creates Strategy instance.
+ * @return Strategy instance
+ */
QSnapshot::Strategy * QSnapshot::Strategy::createInstance( QSnapshot * host ) {
if( Strategy::creator() == nullptr ) {
return new Strategy( host );
}
return Strategy::creator()( host );
}
+/**
+ * @brief Constructor.
+ * @param host The strategy host
+ */
QSnapshot::Strategy::Strategy( QSnapshot * host ):
host( host ) {
}
+/**
+ * @brief Destructor.
+ */
QSnapshot::Strategy::~Strategy() {
}
+/**
+ * @brief Hides QSnapshot immediatly.
+ * @sa fastShow
+ *
+ * This function should disable all window effects temporary.
+ */
void QSnapshot::Strategy::fastHide() {
this->host->hide();
}
+/**
+ * @brief Shows QSnapshot immediatly.
+ * @sa fastHide
+ *
+ * This function should restore window effects which disabled by fastHide.
+ */
void QSnapshot::Strategy::fastShow() {
this->host->show();
}

0 comments on commit 61b3a18

Please sign in to comment.