X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FSlit.h;h=f7feb6b16560a76b05e3f97ef27077f7698585b2;hb=0a3cfdfcb956024639a05549a50586e3d826b42e;hp=1cb89751d004aa5913e190be9459bc94252f6c1c;hpb=dfc5f034581f5a26cba5c4811500438f89f0634a;p=chaz%2Fopenbox diff --git a/src/Slit.h b/src/Slit.h index 1cb89751..f7feb6b1 100644 --- a/src/Slit.h +++ b/src/Slit.h @@ -28,6 +28,7 @@ #include "Basemenu.h" #include "LinkedList.h" +#include "Geometry.h" // forward declaration class Slit; @@ -37,30 +38,32 @@ class Slitmenu : public Basemenu { private: class Directionmenu : public Basemenu { private: - Slitmenu *slitmenu; + Slitmenu &slitmenu; protected: virtual void itemSelected(int, int); + virtual void setValues(); public: - Directionmenu(Slitmenu *); + Directionmenu(Slitmenu &); + void reconfigure(); }; class Placementmenu : public Basemenu { private: - Slitmenu *slitmenu; + Slitmenu &slitmenu; protected: virtual void itemSelected(int, int); public: - Placementmenu(Slitmenu *); + Placementmenu(Slitmenu &); }; Directionmenu *directionmenu; Placementmenu *placementmenu; - Slit *slit; + Slit &slit; friend class Directionmenu; friend class Placementmenu; @@ -69,17 +72,17 @@ private: protected: virtual void itemSelected(int, int); - virtual void internal_hide(void); - + virtual void internal_hide(); + virtual void setValues(); public: - Slitmenu(Slit *); - virtual ~Slitmenu(void); + Slitmenu(Slit &); + virtual ~Slitmenu(); - inline Basemenu *getDirectionmenu(void) { return directionmenu; } - inline Basemenu *getPlacementmenu(void) { return placementmenu; } + inline Basemenu *getDirectionmenu() { return directionmenu; } + inline Basemenu *getPlacementmenu() { return placementmenu; } - void reconfigure(void); + void reconfigure(); }; @@ -93,11 +96,13 @@ private: unsigned int width, height; }; - Bool on_top, hidden, do_auto_hide; + bool m_ontop, m_autohide, m_hidden; + int m_direction, m_placement; Display *display; - Openbox *openbox; - BScreen *screen; + Openbox &openbox; + BScreen &screen; + Resource &config; BTimer *timer; LinkedList *clientList; @@ -107,48 +112,57 @@ private: Pixmap pixmap; Window window; - int x, y, x_hidden, y_hidden; - unsigned int width, height; + Rect area; + Point hidden; } frame; + friend class Slitmenu; friend class Slitmenu::Directionmenu; friend class Slitmenu::Placementmenu; public: - Slit(BScreen *); + Slit(BScreen &, Resource &); virtual ~Slit(); - inline const Bool &isOnTop(void) const { return on_top; } - inline const Bool &isHidden(void) const { return hidden; } - inline const Bool &doAutoHide(void) const { return do_auto_hide; } - inline Slitmenu *getMenu() { return slitmenu; } inline const Window &getWindowID() const { return frame.window; } - inline const int &getX(void) const - { return ((hidden) ? frame.x_hidden : frame.x); } - inline const int &getY(void) const - { return ((hidden) ? frame.y_hidden : frame.y); } - - inline const unsigned int &getWidth(void) const { return frame.width; } - inline const unsigned int &getHeight(void) const { return frame.height; } + inline const Point &origin() const { return frame.area.origin(); } + inline const Size &size() const { return frame.area.size(); } + inline const Rect &area() const { return frame.area; } void addClient(Window); void removeClient(SlitClient *, Bool = True); void removeClient(Window, Bool = True); - void reconfigure(void); - void reposition(void); - void shutdown(void); + void reconfigure(); + void load(); + void save(); + void reposition(); + void shutdown(); void buttonPressEvent(XButtonEvent *); void enterNotifyEvent(XCrossingEvent *); void leaveNotifyEvent(XCrossingEvent *); void configureRequestEvent(XConfigureRequestEvent *); - virtual void timeout(void); + virtual void timeout(); + + inline bool isHidden() const { return m_hidden; } + + inline bool onTop() const { return m_ontop; } + void setOnTop(bool); + + inline bool autoHide() const { return m_autohide; } + void setAutoHide(bool); + + inline int placement() const { return m_placement; } + void setPlacement(int); + + inline int direction() const { return m_direction; } + void setDirection(int); enum { Vertical = 1, Horizontal }; enum { TopLeft = 1, CenterLeft, BottomLeft, TopCenter, BottomCenter,