return priv->getGeometry();
}
+void DSWindowShell::addAuxHint(int32_t id, const std::string &name, const std::string &value)
+{
+ DS_GET_PRIV(DSWindowShell);
+ priv->addAuxHint(id, name, value);
+}
+
+void DSWindowShell::changeAuxHint(int32_t id, const std::string &value)
+{
+ DS_GET_PRIV(DSWindowShell);
+ priv->changeAuxHint(id, value);
+}
+
+void DSWindowShell::removeAuxHint(int32_t id)
+{
+ DS_GET_PRIV(DSWindowShell);
+ priv->removeAuxHint(id);
+}
+
bool DSWindowShell::show(void)
{
DS_GET_PRIV(DSWindowShell);
namespace display_server
{
-struct DTWindowShell
-{
+enum _Hint_Type
+{
+ DS_WINDOW_HINT_USER_GEOMETRY = 0,
+ DS_WINDOW_HINT_FIXED_RESIZE = 1,
+ DS_WINDOW_HINT_DEICONIFY_UPDATE = 2,
+ DS_WINDOW_HINT_ICONIFY = 3,
+ DS_WINDOW_HINT_ABOVE_LOCKSCREEN = 4,
+ DS_WINDOW_HINT_GESTURE_DISABLE = 5,
+ DS_WINDOW_HINT_EFFECT_DISABLE = 6,
+ DS_WINDOW_HINT_MSG_USE = 7,
+ DS_WINDOW_HINT_ALWAYS_SELECTIVE = 8,
+ DS_WINDOW_HINT_DEPENDENT_ROTATION = 9,
+ DS_WINDOW_HINT_ROT_RENDER_NOPENDING = 10,
+ DS_WINDOW_HINT_ICONIFY_BUFFER_FLUSH = 11,
+};
+
+static const char *sHintNames[] =
+{
+ "wm.policy.win.user.geometry",
+ "wm.policy.win.fixed.resize",
+ "wm.policy.win.deiconify.update",
+ "wm.policy.win.iconify",
+ "wm.policy.win.above.lock",
+ "wm.policy.win.gesture.disable",
+ "wm.policy.win.effect.disable",
+ "wm.policy.win.msg.use",
+ "wm.comp.win.always.selective.mode",
+ "wm.policy.win.rot.dependent",
+ "wm.policy.win.rot.render.nopending",
+ "wm.policy.win.iconify.buffer.flush",
};
DSWindowShellPrivate::DSWindowShellPrivate(DSWindowShell *p_ptr, DSWindow *window)
DSWindowShellPrivate::~DSWindowShellPrivate()
{
-
+ for (stWindowAuxHint *hint : __auxHintsList)
+ {
+ delete hint;
+ }
}
bool DSWindowShellPrivate::__findInChildList(DSWindowShell *parentWinShell)
return true;
}
+struct stWindowAuxHint *DSWindowShellPrivate::__findAuxHint(int32_t id)
+{
+ for (stWindowAuxHint* hint : __auxHintsList)
+ {
+ if (hint->id == id)
+ return hint;
+ }
+
+ return nullptr;
+}
+
+void DSWindowShellPrivate::__handleAuxHint(stWindowAuxHint *hint)
+{
+ if (!__window) return;
+
+ // do something for each hints
+ if (hint->name == sHintNames[DS_WINDOW_HINT_USER_GEOMETRY]) // user geometry
+ {
+ bool set;
+
+ if (hint->value == "1")
+ set = true;
+ else
+ set = false;
+
+ __window->allowUserGeometry(set);
+ }
+}
bool DSWindowShellPrivate::create(DSWindowShell *pParent)
{
return geo;
}
+void DSWindowShellPrivate::addAuxHint(int32_t id, const std::string &name, const std::string &value)
+{
+ stWindowAuxHint *hint;
+ hint = __findAuxHint(id);
+ if (!hint)
+ {
+ hint = new stWindowAuxHint();
+ if (!hint) return;
+
+ __auxHintsList.push_back(hint);
+ }
+
+ hint->id = id;
+ hint->name = name;
+ hint->value = value;
+ hint->changed = true;
+ hint->deleted = false;
+
+ DSLOG_DBG("DSWindowShell", "Add aux hint... id:%d, name:%s, value:%s", id, name.c_str(), value.c_str());
+
+ __handleAuxHint(hint);
+}
+
+void DSWindowShellPrivate::changeAuxHint(int32_t id, const std::string &value)
+{
+ stWindowAuxHint *hint;
+ hint = __findAuxHint(id);
+ if (!hint) return;
+
+ hint->value = value;
+ hint->changed = true;
+
+ __handleAuxHint(hint);
+}
+
+void DSWindowShellPrivate::removeAuxHint(int32_t id)
+{
+ stWindowAuxHint *hint;
+ hint = __findAuxHint(id);
+ if (!hint) return;
+
+ hint->changed = true;
+ hint->deleted = true;
+
+ __auxHintsList.remove(hint);
+}
+
bool DSWindowShellPrivate::show(void)
{
return true;
namespace display_server
{
+struct stWindowAuxHint
+{
+ int32_t id;
+ std::string name;
+ std::string value;
+ bool changed;
+ bool deleted;
+};
+
class DSWindowShellPrivate
{
DS_PIMPL_USE_PUBLIC(DSWindowShell)
bool setGeometry(int x, int y, unsigned int w, unsigned int h);
stGeometry getGeometry(void);
+ void addAuxHint(int32_t id, const std::string &name, const std::string &value);
+ void changeAuxHint(int32_t id, const std::string &value);
+ void removeAuxHint(int32_t id);
+
bool show(void);
bool hide(bool autoFocus = true);
int showState(void);
bool __findInChildList(DSWindowShell *parentWinShell);
bool __setParent(DSWindowShell *parentWinShell);
+ struct stWindowAuxHint* __findAuxHint(int32_t id);
+ void __handleAuxHint(stWindowAuxHint *hint);
+
private:
DSWindow *__window;
IDSWaylandShellSurface *__shellSurface;
DSWindowShell *__parent;
int __layer;
std::list<DSWindowShell*> __childList;
+ std::list<stWindowAuxHint*> __auxHintsList;
};
}