2 * Copyright © 2020 Samsung Electronics co., Ltd. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
31 #include "IDSBuffer.h"
32 #include "DSWindowShell.h"
34 namespace display_server
37 class DSWindowPrivate;
38 class DSWaylandSurface;
40 class DSWindow : public DSObject
42 DS_PIMPL_USE_PRIVATE(DSWindow)
46 DSWindow(std::shared_ptr<DSWaylandSurface> waylandSurface);
49 bool create(std::shared_ptr<DSWaylandSurface> waylandSurface);
53 bool hide(bool autoFocus = true);
56 bool setTitle(const std::string &title);
57 const std::string getTitle(void);
59 bool setSkipFocus(bool set);
60 bool getSkipFocus(void);
62 bool setLayer(int layer);
69 void setPosition(int x, int y);
70 stPosition getPosition(void);
73 void setSize(unsigned int w, unsigned int h);
74 void setSize(stSize size);
76 DSWaylandSurface *surface();
78 bool setWindowShell(DSWindowShell *winShell);
79 DSWindowShell *getWindowShell(void);
81 void registerCallbackSizeChanged(DSObject *slot, std::function<void(std::shared_ptr<stSize>)> func);
82 void registerCallbackBufferChanged(DSObject *slot, std::function<void(std::shared_ptr<IDSBuffer>)> func);
85 //virtual bool _onFocus(void);
86 //virtual bool _onShowStateChange(void);
90 DSSignal<std::shared_ptr<stSize>> __sizeChangedSignal;
91 DSSignal<std::shared_ptr<IDSBuffer>> __bufferChangedSignal;
96 #endif // _DS_WINDOW_H_