]> Dogcows Code - chaz/openbox/blobdiff - otk/renderstyle.cc
smaller, non-bold font
[chaz/openbox] / otk / renderstyle.cc
index 8803c7797a786989c7ae493d609124eb520937ba..de34e034615257dd03aee594c20cfe91f8b93cb3 100644 (file)
@@ -5,17 +5,22 @@
 #endif // HAVE_CONFIG_H
 
 #include "renderstyle.hh"
-#include "rendercolor.hh"
-#include "rendertexture.hh"
+#include "display.hh"
+#include "screeninfo.hh"
 
 namespace otk {
 
-RenderStyle(int screen, const std::string &stylefile)
+RenderStyle::RenderStyle(int screen, const std::string &stylefile)
   : _screen(screen),
     _file(stylefile)
 {
-  _text_focus_color = new RenderColor(_screen, 0x272a2f);
-  _text_unfocus_color = new RenderColor(_screen, 0x676869);
+  _root_color = new RenderColor(_screen, 0x272a2f);
+  
+  _text_color_focus = new RenderColor(_screen, 0x272a2f);
+  _text_color_unfocus = new RenderColor(_screen, 0x676869);
+
+  _button_color_focus = new RenderColor(_screen, 0x96ba86);
+  _button_color_unfocus = new RenderColor(_screen, 0x676869);
 
   _frame_border_color = new RenderColor(_screen, 0x181f24);
   _frame_border_width = 1;
@@ -24,7 +29,8 @@ RenderStyle(int screen, const std::string &stylefile)
   _client_border_color_unfocus = new RenderColor(_screen, 0x555657);
   _client_border_width = 1;
 
-  _titlebar_focus = new RenderTexture(false,
+  _titlebar_focus = new RenderTexture(_screen,
+                                      false,
                                       RenderTexture::Flat,
                                       RenderTexture::Bevel1,
                                       false,
@@ -33,10 +39,9 @@ RenderStyle(int screen, const std::string &stylefile)
                                       0x858687,
                                       0x373a3f,
                                       0x0,
-                                      0x0,
-                                      0x0,
                                       0x0);
-  _titlebar_unfocus = new RenderTexture(false,
+  _titlebar_unfocus = new RenderTexture(_screen,
+                                        false,
                                         RenderTexture::Flat,
                                         RenderTexture::Bevel1,
                                         false,
@@ -45,23 +50,21 @@ RenderStyle(int screen, const std::string &stylefile)
                                         0x555657,
                                         0x171a1f,
                                         0x0,
-                                        0x0,
-                                        0x0,
                                         0x0);
 
-  _label_focus = new RenderTexture(false,
+  _label_focus = new RenderTexture(_screen,
+                                   false,
                                    RenderTexture::Flat,
                                    RenderTexture::Bevel1,
                                    true,
                                    RenderTexture::Vertical,
                                    false,
-                                   0x858687,
-                                   0x373a3f,
-                                   0x0,
-                                   0x0,
+                                   0x96ba86,
+                                   0x5a724c,
                                    0x181f24,
                                    0x0);
-  _label_unfocus = new RenderTexture(false,
+  _label_unfocus = new RenderTexture(_screen,
+                                     false,
                                      RenderTexture::Sunken,
                                      RenderTexture::Bevel1,
                                      false,
@@ -69,25 +72,23 @@ RenderStyle(int screen, const std::string &stylefile)
                                      false,
                                      0x555657,
                                      0x272a2f,
-                                     //XXX,
-                                     //XXX,
                                      0x0,
                                      0x0);
 
 
-  _handle_focus = new RenderTexture(false,
+  _handle_focus = new RenderTexture(_screen,
+                                    false,
                                     RenderTexture::Flat,
                                     RenderTexture::Bevel1,
-                                    true,
+                                    false,
                                     RenderTexture::Vertical,
                                     false,
                                     0x858687,
                                     0x373a3f,
                                     0x0,
-                                    0x0,
-                                    0x0,
                                     0x0);
-  _handle_unfocus = new RenderTexture(false,
+  _handle_unfocus = new RenderTexture(_screen,
+                                      false,
                                       RenderTexture::Flat,
                                       RenderTexture::Bevel1,
                                       false,
@@ -96,14 +97,167 @@ RenderStyle(int screen, const std::string &stylefile)
                                       0x555657,
                                       0x171a1f,
                                       0x0,
-                                      0x0,
-                                      0x0,
                                       0x0);
 
+  
+  _button_unpress_focus = new RenderTexture(_screen,
+                                            false,
+                                            RenderTexture::Raised,
+                                            RenderTexture::Bevel2,
+                                            false,
+                                            RenderTexture::CrossDiagonal,
+                                            false,
+                                            0x858687,
+                                            0x272a2f,
+                                            0x0,
+                                            0x0);
+  _button_unpress_unfocus = new RenderTexture(_screen,
+                                              false,
+                                              RenderTexture::Raised,
+                                              RenderTexture::Bevel2,
+                                              false,
+                                              RenderTexture::CrossDiagonal,
+                                              false,
+                                              0x555657,
+                                              0x171a1f,
+                                              0x0,
+                                              0x0);
+
+  _button_press_focus = new RenderTexture(_screen,
+                                          false,
+                                          RenderTexture::Sunken,
+                                          RenderTexture::Bevel2,
+                                          false,
+                                          RenderTexture::CrossDiagonal,
+                                          false,
+                                          0x96ba86,
+                                          0x5a724c,
+                                          0x0,
+                                          0x0);
+  _button_press_unfocus = new RenderTexture(_screen,
+                                            false,
+                                            RenderTexture::Sunken,
+                                            RenderTexture::Bevel2,
+                                            false,
+                                            RenderTexture::CrossDiagonal,
+                                            false,
+                                            0x555657,
+                                            0x171a1f,
+                                            0x0,
+                                            0x0);
+
+  _grip_focus = new RenderTexture(_screen,
+                                  false,
+                                  RenderTexture::Flat,
+                                  RenderTexture::Bevel1,
+                                  false,
+                                  RenderTexture::Vertical,
+                                  false,
+                                  0x96ba86,
+                                  0x5a724c,
+                                  0x0,
+                                  0x0);
+  _grip_unfocus = new RenderTexture(_screen,
+                                    false,
+                                    RenderTexture::Flat,
+                                    RenderTexture::Bevel1,
+                                    false,
+                                    RenderTexture::Vertical,
+                                    false,
+                                    0x555657,
+                                    0x171a1f,
+                                    0x0,
+                                    0x0);
+
+  _label_font = new Font(_screen, "Arial,Sans-8", true, 1, 0x40);
+  _label_justify = RightJustify;
+
+  _max_mask = new PixmapMask();
+  _max_mask->w = _max_mask->h = 8;
+  {
+    //char data[] = { 0x7e, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0x7e };
+    char data []  = {0x00, 0x00, 0x18, 0x3c, 0x66, 0x42, 0x00, 0x00 };
+    _max_mask->mask =
+      XCreateBitmapFromData(**display,
+                            display->screenInfo(_screen)->rootWindow(),
+                            data, 8, 8);
+  }
+
+  _icon_mask = new PixmapMask();
+  _icon_mask->w = _icon_mask->h = 8;
+  {
+    //char data[] = { 0x00, 0x00, 0xc3, 0xe7, 0x7e, 0x3c, 0x18, 0x00 };
+    char data[] = { 0x00, 0x00, 0x42, 0x66, 0x3c, 0x18, 0x00, 0x00 };
+    _icon_mask->mask =
+      XCreateBitmapFromData(**display,
+                            display->screenInfo(_screen)->rootWindow(),
+                            data, 8, 8);
+  }
+  
+  _alldesk_mask = new PixmapMask();
+  _alldesk_mask->w = _alldesk_mask->h = 8;
+  {
+    //char data[] = { 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00 };
+    char data[] = { 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00 };
+    _alldesk_mask->mask =
+      XCreateBitmapFromData(**display,
+                            display->screenInfo(_screen)->rootWindow(),
+                            data, 8, 8);
+  }
+  
+  _close_mask = new PixmapMask();
+  _close_mask->w = _close_mask->h = 8;
+  {
+    //char data[] = { 0xc3, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0xc3 };
+    char data[] = { 0x00, 0xc3, 0x66, 0x3c, 0x3c, 0x66, 0xc3, 0x00 };
+    _close_mask->mask =
+      XCreateBitmapFromData(**display,
+                            display->screenInfo(_screen)->rootWindow(),
+                            data, 8, 8);
+  }
+
+  _bevel_width = 1;
+  _handle_width = 4;
 }
 
-virtual ~RenderStyle()
+RenderStyle::~RenderStyle()
 {
+  delete _root_color;
+  
+  delete _text_color_focus;
+  delete _text_color_unfocus;
+
+  delete _button_color_focus;
+  delete _button_color_unfocus;
+
+  delete _frame_border_color;
+
+  delete _client_border_color_focus; 
+  delete _client_border_color_unfocus;
+  delete _titlebar_focus;
+  delete _titlebar_unfocus;
+
+  delete _label_focus;
+  delete _label_unfocus;
+
+  delete _handle_focus;
+  delete _handle_unfocus;
+
+  delete _button_unpress_focus;
+  delete _button_unpress_unfocus;
+  delete _button_press_focus;
+  delete _button_press_unfocus;
+
+  delete _grip_focus;
+  delete _grip_unfocus;
+
+  delete _label_font;
+
+  delete _max_mask;
+  delete _icon_mask;
+  delete _alldesk_mask;
+  delete _close_mask;
 }
 
 }
This page took 0.027571 seconds and 4 git commands to generate.