{
DS_GET_PUB(DSWindow);
- // set the size of window with the size of commit infomation
- // TODO: It could be changed by DSWindowShell policy later..
std::shared_ptr<IDSBuffer> buffer = waylandSurfaceCommitInfo->getBuffer();
if (buffer) {
+ // TODO: set the size of window with the size of commit information
+ // It could be changed by DSWindowShell policy later..
std::shared_ptr<stSize> bufferSize = buffer->getSize();
__w = bufferSize->w;
__h = bufferSize->h;
- // emit a signal of the size changed
- pub->__sizeChangedSignal.emit(bufferSize);
+ // emit a signal of the buffer changed
+ pub->__bufferChangedSignal.emit(buffer);
}
// TODO: get more information from waylandSurfaceCommitInfo. ex) damageSurface, damageBuffer, transform, scale and so on
__sizeChangedSignal.connect(slot, func);
}
+void DSWindow::registerCallbackBufferChanged(DSObject *slot, std::function<void(std::shared_ptr<IDSBuffer>)> func)
+{
+ __bufferChangedSignal.connect(slot, func);
+}
+
} // namespace display_server
\ No newline at end of file
#include "DSStruct.h"
#include "DSObject.h"
#include "DSSignal.h"
+#include "IDSBuffer.h"
namespace display_server
{
DSWaylandSurface *surface();
void registerCallbackSizeChanged(DSObject *slot, std::function<void(std::shared_ptr<stSize>)> func);
+ void registerCallbackBufferChanged(DSObject *slot, std::function<void(std::shared_ptr<IDSBuffer>)> func);
protected:
//virtual bool _onFocus(void);
private:
// signals
DSSignal<std::shared_ptr<stSize>> __sizeChangedSignal;
+ DSSignal<std::shared_ptr<IDSBuffer>> __bufferChangedSignal;
};
}