fluxbox/src/FbWinFrameTheme.hh

118 lines
4.6 KiB
C++
Raw Normal View History

2003-01-05 22:14:10 +00:00
// FbWinFrameTheme.hh for Fluxbox Window Manager
2006-02-16 06:53:05 +00:00
// Copyright (c) 2003 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
2003-01-05 22:14:10 +00:00
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
#ifndef FBWINFRAMETHEME_HH
#define FBWINFRAMETHEME_HH
#include "FbTk/Font.hh"
#include "FbTk/Texture.hh"
#include "FbTk/Color.hh"
2003-01-05 22:14:10 +00:00
#include "FbTk/Theme.hh"
#include "FbTk/BorderTheme.hh"
2003-08-27 17:52:08 +00:00
#include "FbTk/GContext.hh"
2007-12-28 06:52:48 +00:00
#include "FbTk/Shape.hh"
2003-08-27 17:52:08 +00:00
2007-10-13 21:51:37 +00:00
#include "IconbarTheme.hh"
#include <string>
2003-01-05 22:14:10 +00:00
2008-01-04 09:06:38 +00:00
class FbWinFrameTheme: public FbTk::Theme,
public FbTk::ThemeProxy<FbWinFrameTheme> {
2003-01-05 22:14:10 +00:00
public:
explicit FbWinFrameTheme(int screen_num, const std::string &extra,
const std::string &altextra);
2003-01-05 22:14:10 +00:00
~FbWinFrameTheme();
/**
@name textures
*/
//@{
const FbTk::Texture &titleTexture() const { return *m_title; }
const FbTk::Texture &handleTexture() const { return *m_handle; }
const FbTk::Texture &buttonTexture() const { return *m_button; }
const FbTk::Texture &buttonPressedTexture() const { return *m_button_pressed; }
const FbTk::Texture &gripTexture() const { return *m_grip; }
2003-01-05 22:14:10 +00:00
//@}
const FbTk::Color &buttonColor() const { return *m_button_color; }
2003-01-05 22:14:10 +00:00
FbTk::Font &font() { return *m_font; }
GC buttonPicGC() const { return m_button_pic_gc.gc(); }
2003-01-05 22:14:10 +00:00
bool fallback(FbTk::ThemeItem_base &item);
2003-01-05 22:14:10 +00:00
void reconfigTheme();
2003-02-15 01:59:00 +00:00
Cursor moveCursor() const { return m_cursor_move; }
Cursor lowerLeftAngleCursor() const { return m_cursor_lower_left_angle; }
Cursor lowerRightAngleCursor() const { return m_cursor_lower_right_angle; }
Cursor upperLeftAngleCursor() const { return m_cursor_upper_left_angle; }
Cursor upperRightAngleCursor() const { return m_cursor_upper_right_angle; }
Cursor leftSideCursor() const { return m_cursor_left_side; }
Cursor rightSideCursor() const { return m_cursor_right_side; }
Cursor topSideCursor() const { return m_cursor_top_side; }
Cursor bottomSideCursor() const { return m_cursor_bottom_side; }
2003-06-11 14:52:45 +00:00
FbTk::Shape::ShapePlace shapePlace() const { return *m_shape_place; }
const FbTk::BorderTheme &border() const { return m_border; }
2003-08-04 12:49:20 +00:00
unsigned int titleHeight() const { return *m_title_height; }
unsigned int bevelWidth() const { return *m_bevel_width; }
unsigned int handleWidth() const { return *m_handle_width; }
unsigned char alpha() const { return m_alpha; }
void setAlpha(unsigned char alpha) { m_alpha = alpha; }
IconbarTheme &iconbarTheme() { return m_iconbar_theme; }
2007-10-13 21:51:37 +00:00
2008-01-04 09:06:38 +00:00
virtual FbTk::Subject &reconfigSig() { return FbTk::Theme::reconfigSig(); }
virtual const FbTk::Subject &reconfigSig() const { return FbTk::Theme::reconfigSig(); }
2008-01-05 01:39:19 +00:00
virtual FbWinFrameTheme &operator *() { return *this; }
virtual const FbWinFrameTheme &operator *() const { return *this; }
2008-01-04 09:06:38 +00:00
2003-01-05 22:14:10 +00:00
private:
FbTk::ThemeItem<FbTk::Texture> m_title, m_handle, m_button,
m_button_pressed, m_grip;
FbTk::ThemeItem<FbTk::Color> m_button_color;
2003-01-05 22:14:10 +00:00
FbTk::ThemeItem<FbTk::Font> m_font;
2007-12-28 06:52:48 +00:00
FbTk::ThemeItem<FbTk::Shape::ShapePlace> m_shape_place;
2003-01-05 22:14:10 +00:00
FbTk::ThemeItem<int> m_title_height, m_bevel_width, m_handle_width;
FbTk::BorderTheme m_border;
FbTk::GContext m_button_pic_gc;
2003-08-04 12:49:20 +00:00
Cursor m_cursor_move;
Cursor m_cursor_lower_left_angle;
Cursor m_cursor_lower_right_angle;
Cursor m_cursor_upper_left_angle;
Cursor m_cursor_upper_right_angle;
2007-12-11 19:31:24 +00:00
Cursor m_cursor_left_side;
Cursor m_cursor_right_side;
Cursor m_cursor_top_side;
Cursor m_cursor_bottom_side;
unsigned char m_alpha;
2007-10-13 21:51:37 +00:00
IconbarTheme m_iconbar_theme;
2003-01-05 22:14:10 +00:00
};
#endif // FBWINFRAMETHEME_HH