]> Dogcows Code - chaz/openbox/blobdiff - otk/style.hh
provide the strut for the frame's size instead of an area rect
[chaz/openbox] / otk / style.hh
index d80c6ab9f5aea87c46a2571fb057a3b2e113fdc0..d5d8ee40a31958f5687d2994943d3c42be79c3b8 100644 (file)
@@ -1,3 +1,4 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
 #ifndef __style_hh
 #define __style_hh
 
 
 namespace otk {
 
+struct PixmapMask {
+  Pixmap mask;
+  unsigned int w, h;
+  PixmapMask() { mask = None; w = h = 0; }
+};
+
 class Style {
 public:
 
+  enum Type { ButtonFocus, ButtonUnfocus, TitleFocus, TitleUnfocus,
+              LabelFocus, LabelUnfocus, HandleFocus, HandleUnfocus,
+              GripFocus, GripUnfocus };
+
   enum TextJustify { LeftJustify = 1, RightJustify, CenterJustify };
   enum BulletType { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet };
 
-  struct PixmapMask {
-    Pixmap mask;
-    unsigned int w, h;
-  };
-
 // private:
 
-  BImageControl *image_control;
+  ImageControl *image_control;
 
-  BColor
+  Color
     l_text_focus, l_text_unfocus,
     b_pic_focus, b_pic_unfocus;
   
-  BColor border_color;
+  Color border_color;
 
-  BFont *font;
+  Font *font;
 
-  BTexture
+  Texture
     f_focus, f_unfocus,
     t_focus, t_unfocus,
     l_focus, l_unfocus,
     h_focus, h_unfocus,
     b_focus, b_unfocus,
-    b_pressed, b_pressed_focus, b_pressed_unfocus,
+    b_pressed_focus, b_pressed_unfocus,
     g_focus, g_unfocus;
 
   PixmapMask close_button, max_button, icon_button, stick_button;
   TextJustify justify;
+  BulletType bullet_type;
 
   unsigned int handle_width, bevel_width, frame_width, border_width;
 
@@ -57,45 +64,84 @@ public:
 public:
 
   Style();
-  Style(unsigned int);
-  Style(unsigned int, BImageControl *);
+  Style(ImageControl *);
   ~Style();
 
-  void doJustify(const std::string &text, int &start_pos,
-                 unsigned int max_length, unsigned int modifier) const;
-
   void readDatabaseMask(const std::string &rname,
                         PixmapMask &pixmapMask,
                         const Configuration &style);
   
-  BTexture readDatabaseTexture(const std::string &rname,
-                                    const std::string &default_color,
-                                    const Configuration &style, 
-                                    bool allowNoTexture = false);
+  Texture readDatabaseTexture(const std::string &rname,
+                               const std::string &default_color,
+                               const Configuration &style, 
+                               bool allowNoTexture = false);
+
+  Color readDatabaseColor(const std::string &rname,
+                           const std::string &default_color,
+                           const Configuration &style);
+
+  Font *readDatabaseFont(const std::string &rbasename,
+                          const Configuration &style);
+
+  void load(const Configuration &style);
+
+  inline PixmapMask *getCloseButtonMask(void) { return &close_button; }
+  inline PixmapMask *getMaximizeButtonMask(void) { return &max_button; }
+  inline PixmapMask *getIconifyButtonMask(void) { return &icon_button; }
+  inline PixmapMask *getStickyButtonMask(void) { return &stick_button; }
 
-  BColor readDatabaseColor(const std::string &rname,
-                                const std::string &default_color,
-                                const Configuration &style);
+  inline Color *getTextFocus(void) { return &l_text_focus; }
+  inline Color *getTextUnfocus(void) { return &l_text_unfocus; }
 
-  BFont *readDatabaseFont(const std::string &rbasename,
-                               const Configuration &style);
+  inline Color *getButtonPicFocus(void) { return &b_pic_focus; }
+  inline Color *getButtonPicUnfocus(void) { return &b_pic_unfocus; }
 
-  void load(Configuration &);
+  inline Texture *getTitleFocus(void) { return &t_focus; }
+  inline Texture *getTitleUnfocus(void) { return &t_unfocus; }
+
+  inline Texture *getLabelFocus(void) { return &l_focus; }
+  inline Texture *getLabelUnfocus(void) { return &l_unfocus; }
+
+  inline Texture *getHandleFocus(void) { return &h_focus; }
+  inline Texture *getHandleUnfocus(void) { return &h_unfocus; }
+
+  inline Texture *getButtonFocus(void) { return &b_focus; }
+  inline Texture *getButtonUnfocus(void) { return &b_unfocus; }
+
+  inline Texture *getButtonPressedFocus(void)
+  { return &b_pressed_focus; }
+  inline Texture *getButtonPressedUnfocus(void)
+  { return &b_pressed_unfocus; }
+
+  inline Texture *getGripFocus(void) { return &g_focus; }
+  inline Texture *getGripUnfocus(void) { return &g_unfocus; }
 
   inline unsigned int getHandleWidth(void) const { return handle_width; }
   inline unsigned int getBevelWidth(void) const { return bevel_width; }
   inline unsigned int getFrameWidth(void) const { return frame_width; }
   inline unsigned int getBorderWidth(void) const { return border_width; }
 
-  inline const BFont &getFont() const { return *font; }
+  inline const Font *getFont() const { return font; }
+
+  inline void setShadowFonts(bool fonts) { shadow_fonts = fonts; }
+  inline bool hasShadowFonts(void) const { return shadow_fonts; }
+
+  inline void setAAFonts(bool fonts) { aa_fonts = fonts; }
+  inline bool hasAAFonts(void) const { return aa_fonts; }
+
+  inline TextJustify textJustify(void) { return justify; }
+  inline BulletType bulletType(void) { return bullet_type; }
 
-  inline const BColor &getBorderColor() const { return border_color; }
+  inline const Color *getBorderColor() const { return &border_color; }
 
-  inline const BTexture &getFrameFocus() const { return f_focus; }
-  inline const BTexture &getFrameUnfocus() const { return f_unfocus; }
+  inline const Texture *getFrameFocus() const { return &f_focus; }
+  inline const Texture *getFrameUnfocus() const { return &f_unfocus; }
 
-  inline void setImageControl(BImageControl *c) { image_control = c; }
-  inline void setScreenNumber(unsigned int scr) { screen_number = scr; }
+  inline void setImageControl(ImageControl *c) {
+    image_control = c;
+    screen_number = c->getScreenInfo()->screen();
+  }
+  inline unsigned int getScreen(void) { return screen_number; }
 
   // XXX add inline accessors for the rest of the bummy
 };
This page took 0.026169 seconds and 4 git commands to generate.