X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclient.hh;h=9196d1347e593ab84bee1561c02aff57893760a2;hb=fc7ec94f469a39b529f46507fbf1800e5bf42e1f;hp=83f5f1a025830fd333d4e0fc9e80e2bfbdc14780;hpb=00e2c5aaad4a0831fd1e0d1b1c287df4d6eaac93;p=chaz%2Fopenbox
diff --git a/src/client.hh b/src/client.hh
index 83f5f1a0..9196d134 100644
--- a/src/client.hh
+++ b/src/client.hh
@@ -3,11 +3,11 @@
#define __client_hh
/*! @file client.hh
- @brief The OBClient class maintains the state of a client window by handling
+ @brief The Client class maintains the state of a client window by handling
property changes on the window and some client messages
*/
-#include "widget.hh"
+#include "widgetbase.hh"
#include "otk/point.hh"
#include "otk/strut.hh"
#include "otk/rect.hh"
@@ -26,7 +26,7 @@ extern "C" {
namespace ob {
-class OBFrame;
+class Frame;
//! The MWM Hints as retrieved from the window property
/*!
@@ -34,36 +34,36 @@ class OBFrame;
structure contains 5. We only use the first 3, so that is all gets defined.
*/
struct MwmHints {
- unsigned long flags; //!< A bitmask of OBClient::MwmFlags values
- unsigned long functions; //!< A bitmask of OBClient::MwmFunctions values
- unsigned long decorations;//!< A bitmask of OBClient::MwmDecorations values
- //! The number of elements in the OBClient::MwmHints struct
+ unsigned long flags; //!< A bitmask of Client::MwmFlags values
+ unsigned long functions; //!< A bitmask of Client::MwmFunctions values
+ unsigned long decorations;//!< A bitmask of Client::MwmDecorations values
+ //! The number of elements in the Client::MwmHints struct
static const unsigned int elements = 3;
};
//! Maintains the state of a client window.
/*!
- OBClient maintains the state of a client window. The state consists of the
+ Client maintains the state of a client window. The state consists of the
hints that the application sets on the window, such as the title, or window
gravity.
- OBClient also manages client messages for the client window. When the
+ Client also manages client messages for the client window. When the
application (or any application) requests something to be changed for the
client, it will call the ActionHandler (for client messages) or update the
class' member variables and call whatever is nessary to complete the
change (such as causing a redraw of the titlebar after the title is changed).
*/
-class OBClient : public otk::OtkEventHandler, public OBWidget {
+class Client : public otk::EventHandler, public WidgetBase {
public:
//! The frame window which decorates around the client window
/*!
NOTE: This should NEVER be used inside the client class's constructor!
*/
- OBFrame *frame;
+ Frame *frame;
- //! Holds a list of OBClients
- typedef std::list List;
+ //! Holds a list of Clients
+ typedef std::list List;
//! The possible stacking layers a client window can be a part of
enum StackLayer {
@@ -126,7 +126,7 @@ public:
Func_Maximize = 1 << 3, //!< Allow to be maximized
Func_Close = 1 << 4 //!< Allow to be closed
};
- //! Holds a bitmask of OBClient::Function values
+ //! Holds a bitmask of Client::Function values
typedef unsigned char FunctionFlags;
//! The decorations the client window wants to be displayed on it
@@ -138,7 +138,7 @@ public:
Decor_Sticky = 1 << 5, //!< Display a sticky button
Decor_Close = 1 << 6 //!< Display a close button
};
- //! Holds a bitmask of OBClient::Decoration values
+ //! Holds a bitmask of Client::Decoration values
typedef unsigned char DecorationFlags;
//! Possible actions that can be made with the _NET_WM_STATE client message
@@ -173,10 +173,10 @@ private:
Window _group;
//! The client which this client is a transient (child) for
- OBClient *_transient_for;
+ Client *_transient_for;
//! The clients which are transients (children) of this client
- OBClient::List _transients;
+ Client::List _transients;
//! The desktop on which the window resides (0xffffffff for all desktops)
long _desktop;
@@ -296,38 +296,38 @@ private:
StackLayer _layer;
- //! A bitmask of values in the OBClient::Decoration enum
+ //! A bitmask of values in the Client::Decoration enum
/*!
The values in the variable are the decorations that the client wants to be
displayed around it.
*/
DecorationFlags _decorations;
- //! A bitmask of values in the OBClient::Function enum
+ //! A bitmask of values in the Client::Function enum
/*!
The values in the variable specify the ways in which the user is allowed to
modify this window.
*/
FunctionFlags _functions;
- //! Retrieves the desktop hint's value and sets OBClient::_desktop
+ //! Retrieves the desktop hint's value and sets Client::_desktop
void getDesktop();
- //! Retrieves the window's type and sets OBClient::_type
+ //! Retrieves the window's type and sets Client::_type
void getType();
- //! Gets the MWM Hints and adjusts OBClient::_functions and
- //! OBClient::_decorations
+ //! Gets the MWM Hints and adjusts Client::_functions and
+ //! Client::_decorations
void getMwmHints();
- //! Gets the position and size of the window and sets OBClient::_area
+ //! Gets the position and size of the window and sets Client::_area
void getArea();
//! Gets the net_state hint and sets the boolean flags for any states set in
//! the hint
void getState();
//! Determines if the window uses the Shape extension and sets
- //! OBClient::_shaped
+ //! Client::_shaped
void getShaped();
//! Set up what decor should be shown on the window and what functions should
- //! be allowed (OBClient::_decorations and OBClient::_functions).
+ //! be allowed (Client::_decorations and Client::_functions).
/*!
This also updates the NET_WM_ALLOWED_ACTIONS hint.
*/
@@ -335,11 +335,12 @@ private:
//! Sets the wm_state to the specified value
void setWMState(long state);
- //! Sends the window to the specified desktop
- void setDesktop(long desktop);
//! Adjusts the window's net_state
void setState(StateAction action, long data1, long data2);
+ //! Sends the window to the specified desktop
+ void setDesktop(long desktop);
+
//! Calculates the stacking layer for the client window
void calcLayer();
@@ -363,26 +364,36 @@ private:
//! Change the client's state hints to match the class' data
void changeState();
+
+ //! Request the client to close its window.
+ void close();
+
+ //! Shades or unshades the client window
+ /*!
+ @param shade true if the window should be shaded; false if it should be
+ unshaded.
+ */
+ void shade(bool shade);
public:
#ifndef SWIG
- //! Constructs a new OBClient object around a specified window id
+ //! Constructs a new Client object around a specified window id
/*!
- @param window The window id that the OBClient class should handle
+BB @param window The window id that the Client class should handle
@param screen The screen on which the window resides
*/
- OBClient(int screen, Window window);
- //! Destroys the OBClient object
- virtual ~OBClient();
+ Client(int screen, Window window);
+ //! Destroys the Client object
+ virtual ~Client();
#endif
//! Returns the screen on which the clien resides
inline int screen() const { return _screen; }
- //! Returns the window id that the OBClient object is handling
+ //! Returns the window id that the Client object is handling
inline Window window() const { return _window; }
- //! Returns the type of the window, one of the OBClient::WindowType values
+ //! Returns the type of the window, one of the Client::WindowType values
inline WindowType type() const { return _type; }
//! Returns if the window should be treated as a normal window.
/*!
@@ -443,7 +454,7 @@ public:
inline FunctionFlags funtions() const { return _functions; }
//! Return the client this window is transient for
- inline OBClient *transientFor() const { return _transient_for; }
+ inline Client *transientFor() const { return _transient_for; }
//! Returns if the window is modal
/*!
@@ -453,8 +464,7 @@ public:
inline bool modal() const { return _modal; }
//! Returns if the window is shaded
/*!
- When the window is shaded, only its titlebar is visible, the client itself
- is not mapped
+ When the window is shaded, only its titlebar is visible.
*/
inline bool shaded() const { return _shaded; }
//! Returns if the window is iconified
@@ -502,30 +512,11 @@ public:
*/
void resize(Corner anchor, int w, int h, int x = INT_MIN, int y = INT_MIN);
- //! Request the client to close its window.
- void close();
-
- //! Sets the window's stacking layer
- /*!
- @param l An integer specifying the layer.
- '0' - the normal layer
- '> 0' - the 'above' layer
- '< 0' - the 'below' layer
- */
- void setStackLayer(int l);
-
- //! Shades or unshades the client window
- /*!
- @param shade true if the window should be shaded; false if it should be
- unshaded.
- */
- void shade(bool shade);
-
//! Attempt to focus the client window
- bool focus();
+ bool focus() const;
//! Remove focus from the client window
- void unfocus();
+ void unfocus() const;
virtual void focusHandler(const XFocusChangeEvent &e);
virtual void unfocusHandler(const XFocusChangeEvent &e);