00001 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- 00002 #ifndef __renderstyle_hh 00003 #define __renderstyle_hh 00004 00005 #include "rendertexture.hh" 00006 #include "rendercolor.hh" 00007 #include "font.hh" 00008 00009 #include <string> 00010 00011 namespace otk { 00012 00013 struct PixmapMask { 00014 Pixmap mask; 00015 unsigned int w, h; 00016 PixmapMask() { mask = None; w = h = 0; } 00017 }; 00018 00019 class RenderStyle { 00020 public: 00021 enum TextJustify { 00022 LeftJustify, 00023 RightJustify, 00024 CenterJustify 00025 }; 00026 00027 private: 00028 int _screen; 00029 std::string _file; 00030 00031 RenderColor *_root_color; 00032 00033 RenderColor *_text_color_focus; 00034 RenderColor *_text_color_unfocus; 00035 00036 RenderColor *_button_color_focus; 00037 RenderColor *_button_color_unfocus; 00038 00039 RenderColor *_frame_border_color; 00040 int _frame_border_width; 00041 00042 RenderColor *_client_border_color_focus; 00043 RenderColor *_client_border_color_unfocus; 00044 int _client_border_width; 00045 00046 RenderTexture *_titlebar_focus; 00047 RenderTexture *_titlebar_unfocus; 00048 00049 RenderTexture *_label_focus; 00050 RenderTexture *_label_unfocus; 00051 00052 RenderTexture *_handle_focus; 00053 RenderTexture *_handle_unfocus; 00054 00055 RenderTexture *_button_unpress_focus; 00056 RenderTexture *_button_unpress_unfocus; 00057 RenderTexture *_button_press_focus; 00058 RenderTexture *_button_press_unfocus; 00059 00060 RenderTexture *_grip_focus; 00061 RenderTexture *_grip_unfocus; 00062 00063 Font *_label_font; 00064 TextJustify _label_justify; 00065 00066 PixmapMask *_max_mask; 00067 PixmapMask *_icon_mask; 00068 PixmapMask *_alldesk_mask; 00069 PixmapMask *_close_mask; 00070 00071 int _handle_width; 00072 int _bevel_width; 00073 00074 public: 00075 RenderStyle(int screen, const std::string &stylefile); 00076 virtual ~RenderStyle(); 00077 00078 inline int screen() const { return _screen; } 00079 00080 inline RenderColor *rootColor() const { return _root_color; } 00081 00082 inline RenderColor *textFocusColor() const { return _text_color_focus; } 00083 inline RenderColor *textUnfocusColor() const { return _text_color_unfocus; } 00084 00085 inline RenderColor *buttonFocusColor() const { return _button_color_focus; } 00086 inline RenderColor *buttonUnfocusColor() const 00087 { return _button_color_unfocus; } 00088 00089 inline RenderColor *frameBorderColor() const { return _frame_border_color; } 00090 inline int frameBorderWidth() const { return _frame_border_width; } 00091 00092 inline RenderColor *clientBorderFocusColor() const 00093 { return _client_border_color_focus; } 00094 inline RenderColor *clientBorderUnfocusColor() const 00095 { return _client_border_color_unfocus; } 00096 inline int clientBorderWidth() const { return _client_border_width; } 00097 00098 inline RenderTexture *titlebarFocusBackground() const 00099 { return _titlebar_focus; } 00100 inline RenderTexture *titlebarUnfocusBackground() const 00101 { return _titlebar_unfocus; } 00102 00103 inline RenderTexture *labelFocusBackground() const { return _label_focus; } 00104 inline RenderTexture *labelUnfocusBackground() const { return _label_unfocus;} 00105 00106 inline RenderTexture *handleFocusBackground() const { return _handle_focus; } 00107 inline RenderTexture *handleUnfocusBackground() const 00108 { return _handle_unfocus; } 00109 00110 inline RenderTexture *buttonUnpressFocusBackground() const 00111 { return _button_unpress_focus; } 00112 inline RenderTexture *buttonUnpressUnfocusBackground() const 00113 { return _button_unpress_unfocus; } 00114 inline RenderTexture *buttonPressFocusBackground() const 00115 { return _button_press_focus; } 00116 inline RenderTexture *buttonPressUnfocusBackground() const 00117 { return _button_press_unfocus; } 00118 00119 inline RenderTexture *gripFocusBackground() const { return _grip_focus; } 00120 inline RenderTexture *gripUnfocusBackground() const { return _grip_unfocus; } 00121 00122 inline Font *labelFont() const { return _label_font; } 00123 inline TextJustify labelTextJustify() const { return _label_justify; } 00124 00125 inline PixmapMask *maximizeMask() const { return _max_mask; } 00126 inline PixmapMask *iconifyMask() const { return _icon_mask; } 00127 inline PixmapMask *alldesktopsMask() const { return _alldesk_mask; } 00128 inline PixmapMask *closeMask() const { return _close_mask; } 00129 00130 inline int handleWidth() const { return _handle_width; } 00131 inline int bevelWidth() const { return _bevel_width; } 00132 }; 00133 00134 } 00135 00136 #endif // __rendertexture_hh