--===============3397924185865748918== Content-Type: multipart/alternative; boundary="===============6676175158473405648==" --===============6676175158473405648== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/107817/#review23952 ----------------------------------------------------------- Random thoughts: kwin/x11utils.h namespace Xcb? Xqb? XQB? XCB? X_C_B? >-) (XKB is unfortunately a bit "taken") = = Oh, and in that namespace sth. like typedef xcb_window_t Window; // ahhh... much better now ;-) kwin/x11utils.h brace operator? ;-) = private: Cookie m_cookie; Reply *m_reply; bool m_stub; = public: inline Reply *operator->() const { if (m_stub) m_reply =3D replyFunc(connection(), m_cookie, NULL); return m_reply; // can be 0 } = inline bool isValid() { if (m_stub) m_reply =3D replyFunc(connection(), m_cookie, NULL); return bool(m_reply); } = // do we need this? needs isValid for deref. inline T &operator*() const { if (m_stub) m_reply =3D replyFunc(connection(), m_cookie, NULL); return *m_reply; // can be 0 } = ~XcbWrapper() { // "Helper is sooooo generic ;-) if (m_reply) free(m_reply); } kwin/x11utils.h Since the constructor takes one argument, being "xcb_winddow_t" (nur ec= ht mit deppen_unter_strich) it's not gonna be the attributes of your wife o= r geometry of germany - ie. do we need the explicit "Window" tag in this co= ntext (and namespace)? kwin/x11utils.h WindowGeometry someGeometry(window); QRect r =3D someGeometry().toRect(); // we hopefully don't have a KWin:= :someGeometry() ... = --- = Geometry someGeometry(window); QRect r =3D someGeometry->rect(); - Thomas L=C3=BCbking On Dec. 24, 2012, 8:05 a.m., Martin Gr=C3=A4=C3=9Flin wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/107817/ > ----------------------------------------------------------- > = > (Updated Dec. 24, 2012, 8:05 a.m.) > = > = > Review request for kwin and Fredrik H=C3=B6glund. > = > = > Description > ------- > = > Port Input Window handling for Effects to XCB > = > = > Introduce helper classes to perform common xcb requests > = > Two function objects WindowGeometry and WindowAttributes which can be > used to request the geometry and attributes more easily. > = > The ctor performs the async request and the operator() provides the > reply and will block. The WindowGeometry class also provides a convenient > method to provide the result as a QRect. > = > It's the task of the callee to free the returned object. > = > These functors are implemented by using a templated class called > XcbHelper. WindowAttributes is in fact just a typedef with all template > parameters being specified and WindowGeometry inherits to be able to add > another function. The templated approach should make it easy to add new > function object classes when needed. > = > = > Diffs > ----- > = > kwin/effects.h d985de4e4f76ecb53099b36d22e7678ba199b9f3 = > kwin/effects.cpp 70258835054cb579625bc42ea7f077a718d06104 = > kwin/libkwineffects/kwineffects.h 6aea85d20772a8a69855b81ef687b91dc93b9= 8ac = > kwin/libkwineffects/kwineffects.cpp 4895ca0e1e4fce2ca38330cf6d5cd8a350b= aad94 = > kwin/x11utils.h PRE-CREATION = > = > Diff: http://git.reviewboard.kde.org/r/107817/diff/ > = > = > Testing > ------- > = > = > Thanks, > = > Martin Gr=C3=A4=C3=9Flin > = > --===============6676175158473405648== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable
This is an automatically generated e-mail. To reply, visit: http://git.revie= wboard.kde.org/r/107817/

Random tho=
ughts:

= =
kwin/x11utils.h (Diff revision 5)
namespace KWin
33
namespace X11
namespace Xcb? Xqb? XQB? XCB?
X_C_B? >-)
(XKB is unfortunately a bit "taken")


Oh, and in that namespace sth. like
typedef xcb_window_t Window; // ahhh... much better now ;-)

= =
kwin/x11utils.h (Diff revision 5)
namespace KWin
46
    Reply *operator()() {
brace operator? ;-)

private:
Cookie m_cookie;
Reply *m_reply;
bool m_stub;

public:
inline Reply *operator->() const {
   if (m_stub)
      m_reply =3D replyFunc(connection(), m_cookie, NULL);
      return m_reply; // can be 0
}

inline bool isValid()  {
   if (m_stub)
      m_reply =3D replyFunc(connection(), m_cookie, NULL);
      return bool(m_reply);
}

// do we need this? needs isValid for deref.
inline T &operator*() const {
   if (m_stub)
      m_reply =3D replyFunc(connection(), m_cookie, NULL);
      return *m_reply; // can be 0
}

~XcbWrapper() { // "Helper is sooooo generic ;-)
   if (m_reply) free(m_reply);
}

= =
kwin/x11utils.h (Diff revision 5)
namespace KWin
53
typedef XcbHelper<xcb_g=
et_window_attributes_reply_t, xcb_get_window_attributes_cookie_t, =
&xcb_get_window_attributes_r=
eply, &xcb_get_window_attributes_unchecked>=
 WindowAttributes;=
Since the constructor takes one argument, being "xcb_winddow_t&=
quot; (nur echt mit deppen_unter_strich) it's not gonna be the attribut=
es of your wife or geometry of germany - ie. do we need the explicit "=
Window" tag in this context (and namespace)?

= =
kwin/x11utils.h (Diff revision 5)
namespace KWin
61
    QRect toRect() {<=
/pre>
WindowGeometry someGeometry(window);
QRect r =3D someGeometry().toRect(); // we hopefully don't have a KWin:=
:someGeometry() ...

---

Geometry someGeometry(window);
QRect r =3D someGeometry->rect();

- Thomas


On December 24th, 2012, 8:05 a.m., Martin Gr=C3=A4=C3=9Flin wrote:

Review request for kwin and Fredrik H=C3=B6glund.
By Martin Gr=C3=A4=C3=9Flin.

Updated Dec. 24, 2012, 8:05 a.m.

Descripti= on

Port Input Window handling for Effects to XCB


Introduce helper classes to perform common xcb requests

Two function objects WindowGeometry and WindowAttributes which can be
used to request the geometry and attributes more easily.

The ctor performs the async request and the operator() provides the
reply and will block. The WindowGeometry class also provides a convenient
method to provide the result as a QRect.

It's the task of the callee to free the returned object.

These functors are implemented by using a templated class called
XcbHelper. WindowAttributes is in fact just a typedef with all template
parameters being specified and WindowGeometry inherits to be able to add
another function. The templated approach should make it easy to add new
function object classes when needed.

Diffs=

  • kwin/effects.h (d985de4e4f76ecb53099b36d22= e7678ba199b9f3)
  • kwin/effects.cpp (70258835054cb579625bc42e= a7f077a718d06104)
  • kwin/libkwineffects/kwineffects.h (6aea85d= 20772a8a69855b81ef687b91dc93b98ac)
  • kwin/libkwineffects/kwineffects.cpp (4895c= a0e1e4fce2ca38330cf6d5cd8a350baad94)
  • kwin/x11utils.h (PRE-CREATION)

View Diff

--===============6676175158473405648==-- --===============3397924185865748918== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kwin mailing list kwin@kde.org https://mail.kde.org/mailman/listinfo/kwin --===============3397924185865748918==--