1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
13 #include "otk/strut.hh"
14 #include "otk/rect.hh"
15 #include "otk/screeninfo.hh"
16 #include "otk/style.hh"
17 #include "otk/widget.hh"
18 #include "otk/button.hh"
19 #include "otk/focuswidget.hh"
20 #include "otk/focuslabel.hh"
26 //! Holds and decorates a frame around an OBClient (client window)
29 class OBFrame : public otk::OtkWidget {
32 const otk::ScreenInfo *_screen;
34 //! The style to use for size and display the decorations
37 //! The size of the frame on each side of the client window
41 otk::OtkFocusWidget _plate; // sits entirely under the client window
42 otk::OtkFocusWidget _titlebar;
43 otk::OtkButton _button_close;
44 otk::OtkButton _button_iconify;
45 otk::OtkButton _button_max;
46 otk::OtkButton _button_stick;
47 otk::OtkFocusLabel _label;
48 otk::OtkFocusWidget _handle;
49 otk::OtkButton _grip_left;
50 otk::OtkButton _grip_right;
52 //! The decorations to display on the window.
54 This is by default the same value as in the OBClient::decorations, but it
55 is duplicated here so that it can be overridden per-window by the user.
57 OBClient::DecorationFlags _decorations;
59 //! Creates the base frame window
61 //! Creates a child frame decoration element window
62 Window createChild(Window parent, Cursor cursor);
64 //! Reparents the client window from the root window onto the frame
66 //! Reparents the client window back to the root window
68 @param remap Re-map the client window when we're done reparenting?
70 void releaseClient(bool remap);
73 //! Constructs an OBFrame object, and reparents the client to itself
75 @param client The client window which will be decorated by the new OBFrame
76 @param style The style to use to decorate the frame
78 OBFrame(OBClient *client, otk::Style *style);
79 //! Destroys the OBFrame object
82 //! Set the style to decorate the frame with
83 virtual void setStyle(otk::Style *style);
85 //! Update the frame to match the client
87 //! Shape the frame window to the client window