#include <X11/Xlib.h>
}
+#include "client.hh"
#include "python.hh"
#include "otk/strut.hh"
#include "otk/rect.hh"
#include "otk/eventhandler.hh"
#include <string>
+#include <vector>
namespace ob {
-class Client;
-
//! Varius geometry settings in the frame decorations
struct FrameGeometry {
int width; // title and handle
int label_width;
int label_height() { return font_height; }
int handle_height; // static, from the style
+ int icon_x; // x-position of the window icon button
int handle_y;
int button_size; // static, from the style
int grip_width() { return button_size * 2; }
otk::Rect _area;
bool _visible;
+
+ //! The decorations that are being displayed in the frame.
+ Client::DecorationFlags _decorations;
// decoration windows
Window _frame; // sits under everything
Window _handle; // bottom bar
Window _lgrip; // lefthand resize grab on the handle
Window _rgrip; // righthand resize grab on the handle
- Window *_buttons; // all of the titlebar buttons
- int _numbuttons; // number of buttons, size of _buttons array
- int *_titleorder; // order of the buttons and the label (always
- // holds '_numbuttons + 1' elements (for the
- // label, which is coded as '-1')
+ Window _max; // maximize button
+ Window _desk; // all-desktops button
+ Window _iconify; // iconify button
+ Window _icon; // window icon button
+ Window _close; // close button
// surfaces for each
otk::Surface *_frame_sur;
otk::Surface *_label_sur;
otk::Surface *_handle_sur;
otk::Surface *_grip_sur;
- otk::Surface **_buttons_sur;
+ otk::Surface *_max_sur;
+ otk::Surface *_desk_sur;
+ otk::Surface *_iconify_sur;
+ otk::Surface *_icon_sur;
+ otk::Surface *_close_sur;
+
+ otk::ustring _layout; // layout of the titlebar
+
+ bool _max_press;
+ bool _desk_press;
+ bool _iconify_press;
+ bool _icon_press;
+ bool _close_press;
+ unsigned int _press_button; // mouse button that started the press
FrameGeometry geom;
void applyStyle(const otk::RenderStyle &style);
void layoutTitle();
void renderLabel();
+ void renderMax();
+ void renderDesk();
+ void renderIconify();
+ void renderClose();
+ void renderIcon();
public:
//! Constructs an Frame object for a client
void adjustState();
void adjustFocus();
void adjustTitle();
+ void adjustIcon();
//! Applies gravity to the client's position to find where the frame should
//! be positioned.
//! Hides the frame
void hide();
+ void buttonPressHandler(const XButtonEvent &e);
+ void buttonReleaseHandler(const XButtonEvent &e);
+
//! Returns the MouseContext for the given window id
/*!
Returns '-1' if no valid mouse context exists in the frame for the given