From 16d5dfd6f2c1359428ea02cd3c34fc37ac130e78 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 10 Jul 2003 11:36:21 +0000 Subject: added shape --- src/FbWinFrame.cc | 23 ++++++++++++++++------- src/FbWinFrame.hh | 15 +++++++++------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index e65e61b..a848788 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -19,15 +19,16 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.29 2003/06/24 14:05:00 fluxgen Exp $ +// $Id: FbWinFrame.cc,v 1.30 2003/07/10 11:36:21 fluxgen Exp $ #include "FbWinFrame.hh" #include "ImageControl.hh" #include "EventManager.hh" #include "TextButton.hh" #include "App.hh" +#include "FbWinFrameTheme.hh" #ifdef SHAPE -//#include "Shape.hh" +#include "Shape.hh" #endif // SHAPE #include @@ -71,9 +72,8 @@ FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, m_focused(false), m_visible(false), m_button_pm(0), - m_themelistener(*this) { - - // m_shape(new Shape(m_window, 0)) { //Shape::TOPLEFT | Shape::TOPRIGHT)) { + m_themelistener(*this), + m_shape(new Shape(m_window, theme.shapePlace())) { theme.addListener(m_themelistener); init(); } @@ -488,8 +488,6 @@ void FbWinFrame::configureNotifyEvent(XConfigureEvent &event) { void FbWinFrame::reconfigure() { m_window.clear(); - // if (m_shape.get()) - // m_shape->update(); // align titlebar and render it if (m_use_titlebar) @@ -542,6 +540,17 @@ void FbWinFrame::reconfigure() { renderButtons(); if (!m_shaded) renderHandles(); + + if (m_shape.get() && theme().shapePlace() == Shape::NONE) + m_shape.reset(0); + else if (m_shape.get() == 0 && theme().shapePlace() != Shape::NONE) + m_shape.reset(new Shape(window(), theme().shapePlace())); + else if (m_shape.get()) + m_shape->setPlaces(theme().shapePlace()); + + if (m_shape.get()) + m_shape->update(); + // titlebar stuff rendered already by reconftitlebar } diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index 74d1e76..49bb452 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -19,27 +19,29 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.hh,v 1.8 2003/05/21 23:59:53 rathnor Exp $ +// $Id: FbWinFrame.hh,v 1.9 2003/07/10 11:36:21 fluxgen Exp $ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH #include "FbWindow.hh" -#include "Button.hh" #include "EventHandler.hh" -#include "Font.hh" -#include "Text.hh" -#include "FbWinFrameTheme.hh" #include "RefCount.hh" -#include "Command.hh" #include "Observer.hh" +#include "Color.hh" +#include "FbPixmap.hh" #include #include +#include +class Shape; class FbWinFrameTheme; namespace FbTk { class ImageControl; +class Command; +class Button; +class Texture; }; /// holds a window frame with a client window @@ -266,6 +268,7 @@ private: FbWinFrame &m_frame; }; ThemeListener m_themelistener; + std::auto_ptr m_shape; }; #endif // FBWINFRAME_HH -- cgit v0.11.2