1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
15 #include "otk/strut.hh"
16 #include "otk/rect.hh"
17 #include "otk/screeninfo.hh"
18 #include "otk/style.hh"
22 //! Holds and decorates a frame around an OBClient (client window)
27 const OBClient *_client;
28 const otk::ScreenInfo *_screen;
30 //! The style to use for size and display the decorations
31 const otk::Style *_style;
33 //! The window id of the base frame window
35 //! The size of the frame on each side of the client window
40 otk::Rect _titlebar_area;
43 otk::Rect _button_close_area;
45 Window _button_iconify;
46 otk::Rect _button_iconify_area;
49 otk::Rect _button_max_area;
52 otk::Rect _button_stick_area;
55 otk::Rect _label_area;
58 otk::Rect _handle_area;
61 otk::Rect _grip_left_area;
64 otk::Rect _grip_right_area;
66 //! The decorations to display on the window.
68 This is by default the same value as in the OBClient::decorations, but it
69 is duplicated here so that it can be overridden per-window by the user.
71 OBClient::DecorationFlags _decorations;
73 //! Creates the base frame window
75 //! Creates a child frame decoration element window
76 Window createChild(Window parent, Cursor cursor);
78 //! Reparents the client window from the root window onto the frame
80 //! Reparents the client window back to the root window
82 @param remap Re-map the client window when we're done reparenting?
84 void releaseClient(bool remap);
87 //! Constructs an OBFrame object, and reparents the client to itself
89 @param client The client window which will be decorated by the new OBFrame
90 @param style The style to use to decorate the frame
92 OBFrame(const OBClient *client, const otk::Style *style);
93 //! Destroys the OBFrame object
96 //! Load a style to decorate the frame with
97 void loadStyle(const otk::Style *style);
99 //! Update the frame to match the client
101 //! Shape the frame window to the client window
104 //! Returns the frame's most-parent window, which is a child of the root
106 inline Window window() const { return _window; }
108 inline Window titlebar() const { return _titlebar; }
109 inline Window label() const { return _label; }
110 inline Window buttonIconify() const { return _button_iconify; }
111 inline Window buttonMax() const { return _button_max; }
112 inline Window buttonStick() const { return _button_stick; }
113 inline Window buttonClose() const { return _button_close; }
114 inline Window handle() const { return _handle; }
115 inline Window gripLeft() const { return _grip_left; }
116 inline Window gripRight() const { return _grip_right; }