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 _titlebar;
42 otk::OtkButton _button_close;
43 otk::OtkButton _button_iconify;
44 otk::OtkButton _button_max;
45 otk::OtkButton _button_stick;
46 otk::OtkFocusLabel _label;
47 otk::OtkFocusWidget _handle;
48 otk::OtkButton _grip_left;
49 otk::OtkButton _grip_right;
51 //! The decorations to display on the window.
53 This is by default the same value as in the OBClient::decorations, but it
54 is duplicated here so that it can be overridden per-window by the user.
56 OBClient::DecorationFlags _decorations;
58 //! Creates the base frame window
60 //! Creates a child frame decoration element window
61 Window createChild(Window parent, Cursor cursor);
63 //! Reparents the client window from the root window onto the frame
65 //! Reparents the client window back to the root window
67 @param remap Re-map the client window when we're done reparenting?
69 void releaseClient(bool remap);
72 //! Constructs an OBFrame object, and reparents the client to itself
74 @param client The client window which will be decorated by the new OBFrame
75 @param style The style to use to decorate the frame
77 OBFrame(OBClient *client, otk::Style *style);
78 //! Destroys the OBFrame object
81 //! Set the style to decorate the frame with
82 virtual void setStyle(otk::Style *style);
84 //! Update the frame to match the client
86 //! Shape the frame window to the client window