X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FWindow.h;h=efc212eb8be0a1e8b05a5dc4a2278af86ed93c8e;hb=0cfca85d27213ef8a308a6d6a5242432ee786837;hp=d6e9f809ea09792ba01a0503d76ccb6a9a33bbe2;hpb=dfc5f034581f5a26cba5c4811500438f89f0634a;p=chaz%2Fopenbox diff --git a/src/Window.h b/src/Window.h index d6e9f809..efc212eb 100644 --- a/src/Window.h +++ b/src/Window.h @@ -32,6 +32,7 @@ #include "BaseDisplay.h" #include "Timer.h" #include "Windowmenu.h" +#include "Geometry.h" // forward declaration class OpenboxWindow; @@ -66,7 +67,7 @@ typedef struct MwmHints { class OpenboxWindow : public TimeoutHandler { private: BImageControl *image_ctrl; - Openbox *openbox; + Openbox &openbox; BScreen *screen; Display *display; BTimer *timer; @@ -110,7 +111,7 @@ private: } flags; struct _client { - OpenboxWindow *transient_for, // which window are we a transient for? + OpenboxWindow *transient_for, // which window are we a transient for? *transient; // which window is our transient? Window window, // the client's window @@ -198,7 +199,7 @@ private: unsigned int width, height, title_h, label_w, label_h, handle_h, button_w, button_h, grip_w, grip_h, mwm_border_w, border_h, border_w, - bevel_w, snap_w, snap_h; + bevel_w; } frame; protected: @@ -238,7 +239,7 @@ protected: public: - OpenboxWindow(Openbox *b, Window w, BScreen *s = (BScreen *) 0); + OpenboxWindow(Openbox &b, Window w, BScreen *s = (BScreen *) 0); virtual ~OpenboxWindow(void); inline Bool isTransient(void) const { return flags.transient; } @@ -278,7 +279,12 @@ public: inline const int &getWindowNumber(void) const { return window_number; } inline const unsigned int &getWidth(void) const { return frame.width; } - inline const unsigned int &getHeight(void) const { return frame.height; } + inline const unsigned int &getHeight(void) const { + if (!flags.shaded) + return frame.height; + else + return frame.title_h; + } inline const unsigned int &getClientHeight(void) const { return client.height; } inline const unsigned int &getClientWidth(void) const @@ -286,6 +292,25 @@ public: inline const unsigned int &getTitleHeight(void) const { return frame.title_h; } + inline const Point getOrigin() const { + return Point(frame.x, frame.y); + } + inline const Point getClientOrigin() const { + return Point(client.x, client.y); + } + inline const Size getSize() const { + return Size(frame.width, frame.height); + } + inline const Size getClientSize() const { + return Size(client.width, client.height); + } + inline const Rect getArea() const { + return Rect(frame.x, frame.y, frame.width, frame.height); + } + inline const Rect getClientArea() const { + return Rect(client.x, client.y, client.width, client.height); + } + inline void setWindowNumber(int n) { window_number = n; } Bool validateClient(void);