]> Dogcows Code - chaz/openbox/blobdiff - src/screen.cc
pretty sure all frame elements are placed correctly now
[chaz/openbox] / src / screen.cc
index 4afe22a581addfdb69103cf8bca188110269ade1..d6350c2e4a82f0b727eb8f7d0d9d6511a56d4bba 100644 (file)
@@ -59,12 +59,10 @@ using std::string;
 #include "otk/gccache.hh"
 #include "otk/image.hh"
 #include "otk/assassin.hh"
+#include "otk/util.hh"
 #include "openbox.hh"
-#include "util.hh"
 #include "bbwindow.hh"
 #include "workspace.hh"
-#include "util.hh"
-#include "xatom.hh"
 
 #ifndef   FONT_ELEMENT_SIZE
 #define   FONT_ELEMENT_SIZE 50
@@ -88,7 +86,7 @@ static int anotherWMRunning(Display *display, XErrorEvent *) {
 
 BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(scrn) {
   blackbox = bb;
-  screenstr = "session.screen" + itostring(scrn) + '.';
+  screenstr = "session.screen" + otk::itostring(scrn) + '.';
   config = blackbox->getConfig();
   xatom = blackbox->getXAtom();
 
@@ -112,18 +110,19 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(scrn) {
 
   geom_pixmap = None;
 
-  xatom->setSupported(this);    // set-up netwm support
+//  xatom->setSupported(this);    // set-up netwm support
 #ifdef    HAVE_GETPID
-  xatom->setValue(getRootWindow(), XAtom::blackbox_pid, XAtom::cardinal,
+  xatom->setValue(getRootWindow(), otk::OBProperty::blackbox_pid,
+                  otk::OBProperty::Atom_Cardinal,
                   (unsigned long) getpid());
 #endif // HAVE_GETPID
   unsigned long geometry[] = { getWidth(),
                                getHeight()};
-  xatom->setValue(getRootWindow(), XAtom::net_desktop_geometry,
-                  XAtom::cardinal, geometry, 2);
+  xatom->set(getRootWindow(), otk::OBProperty::net_desktop_geometry,
+             otk::OBProperty::Atom_Cardinal, geometry, 2);
   unsigned long viewport[] = {0,0};
-  xatom->setValue(getRootWindow(), XAtom::net_desktop_viewport,
-                  XAtom::cardinal, viewport, 2);
+  xatom->set(getRootWindow(), otk::OBProperty::net_desktop_viewport,
+             otk::OBProperty::Atom_Cardinal, viewport, 2);
                   
 
   XDefineCursor(otk::OBDisplay::display, getRootWindow(),
@@ -139,6 +138,10 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(scrn) {
   root_colormap_installed = True;
 
   load_rc();
+
+  // XXX: ugh
+  resource.wstyle.setImageControl(image_control);
+  resource.wstyle.setScreenNumber(scrn);
   LoadStyle();
 
   XGCValues gcv;
@@ -150,8 +153,8 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(scrn) {
                    GCForeground | GCFunction | GCSubwindowMode, &gcv);
 
   const char *s = "0: 0000 x 0: 0000";
-  geom_w = resource.wstyle.font->measureString(s) + resource.bevel_width * 2;
-  geom_h = resource.wstyle.font->height() + resource.bevel_width * 2;
+  geom_w = resource.wstyle.font->measureString(s) + resource.wstyle.bevel_width * 2;
+  geom_h = resource.wstyle.font->height() + resource.wstyle.bevel_width * 2;
 
   XSetWindowAttributes attrib;
   unsigned long mask = CWBorderPixel | CWColormap | CWSaveUnder;
@@ -159,8 +162,10 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(scrn) {
   attrib.colormap = getColormap();
   attrib.save_under = True;
 
+  // XXX -- move this geom_* crap out of here
+
   geom_window = XCreateWindow(otk::OBDisplay::display, getRootWindow(),
-                              0, 0, geom_w, geom_h, resource.border_width,
+                              0, 0, geom_w, geom_h, resource.wstyle.border_width,
                               getDepth(), InputOutput, getVisual(),
                               mask, &attrib);
   geom_visible = False;
@@ -188,14 +193,17 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(scrn) {
     Workspace *wkspc = new Workspace(this, workspacesList.size());
     workspacesList.push_back(wkspc);
   }
+
+  // /GEOM_PIXMAP
+
   saveWorkspaceNames();
 
   updateNetizenWorkspaceCount();
 
   current_workspace = workspacesList.front();
   
-  xatom->setValue(getRootWindow(), XAtom::net_current_desktop,
-                  XAtom::cardinal, 0); //first workspace
+  xatom->set(getRootWindow(), otk::OBProperty::net_current_desktop,
+             otk::OBProperty::Atom_Cardinal, 0); //first workspace
 
   raiseWindows(0, 0);     // this also initializes the empty stacking list
 
@@ -272,26 +280,31 @@ BScreen::~BScreen(void) {
 
   delete image_control;
 
-  if (resource.wstyle.font)
-    delete resource.wstyle.font;
-
-  if (resource.wstyle.close_button.mask != None)
-    XFreePixmap(otk::OBDisplay::display, resource.wstyle.close_button.mask);
-  if (resource.wstyle.max_button.mask != None)
-    XFreePixmap(otk::OBDisplay::display, resource.wstyle.max_button.mask);
-  if (resource.wstyle.icon_button.mask != None)
-    XFreePixmap(otk::OBDisplay::display, resource.wstyle.icon_button.mask);
-  if (resource.wstyle.stick_button.mask != None)
-    XFreePixmap(otk::OBDisplay::display, resource.wstyle.stick_button.mask);
-
-  resource.wstyle.max_button.mask = resource.wstyle.close_button.mask =
-    resource.wstyle.icon_button.mask =
-    resource.wstyle.stick_button.mask = None;
+  // delete style
   
   XFreeGC(otk::OBDisplay::display, opGC);
 }
 
 
+void BScreen::LoadStyle(void) {
+  otk::Configuration style_conf(False);
+
+  const char *sfile = blackbox->getStyleFilename();
+  if (sfile != NULL) {
+    style_conf.setFile(sfile);
+    if (! style_conf.load()) {
+      style_conf.setFile(DEFAULTSTYLE);
+      if (! style_conf.load())
+        style_conf.create();  // hardcoded default values will be used.
+    }
+  }
+
+  // merge in the rc file
+  style_conf.merge(config->file(), True);
+
+  resource.wstyle.load(style_conf);
+}
+
 void BScreen::saveSloppyFocus(bool s) {
   resource.sloppy_focus = s;
 
@@ -630,7 +643,7 @@ void BScreen::load_rc(void) {
     resource.col_direction = TopBottom;
 
   if (config->getValue(screenstr + "workspaceNames", s)) {
-    XAtom::StringVect workspaceNames;
+    otk::OBProperty::StringVect workspaceNames;
 
     string::const_iterator it = s.begin(), end = s.end();
     while(1) {
@@ -642,8 +655,8 @@ void BScreen::load_rc(void) {
       ++it;
     }
 
-    xatom->setValue(getRootWindow(), XAtom::net_desktop_names, XAtom::utf8,
-                    workspaceNames);
+    xatom->set(getRootWindow(), otk::OBProperty::net_desktop_names,
+               otk::OBProperty::utf8, workspaceNames);
   }
 
   resource.sloppy_focus = true;
@@ -744,8 +757,8 @@ void BScreen::reconfigure(void) {
 
   const char *s = "0: 0000 x 0: 0000";
 
-  geom_w = resource.wstyle.font->measureString(s) + resource.bevel_width * 2;
-  geom_h = resource.wstyle.font->height() + resource.bevel_width * 2;
+  geom_w = resource.wstyle.font->measureString(s) + resource.wstyle.bevel_width * 2;
+  geom_h = resource.wstyle.font->height() + resource.wstyle.bevel_width * 2;
 
   otk::BTexture* texture = &(resource.wstyle.l_focus);
   geom_pixmap = texture->render(geom_w, geom_h, geom_pixmap);
@@ -761,9 +774,9 @@ void BScreen::reconfigure(void) {
                                geom_window, geom_pixmap);
 
   XSetWindowBorderWidth(otk::OBDisplay::display, geom_window,
-                        resource.border_width);
+                        resource.wstyle.border_width);
   XSetWindowBorder(otk::OBDisplay::display, geom_window,
-                   resource.border_color.pixel());
+                   resource.wstyle.border_color.pixel());
 
   typedef std::vector<int> SubList;
   SubList remember_subs;
@@ -784,150 +797,11 @@ void BScreen::reconfigure(void) {
 }
 
 
-void BScreen::LoadStyle(void) {
-  Configuration style(False);
-
-  const char *sfile = blackbox->getStyleFilename();
-  if (sfile != NULL) {
-    style.setFile(sfile);
-    if (! style.load()) {
-      style.setFile(DEFAULTSTYLE);
-      if (! style.load())
-        style.create();  // hardcoded default values will be used.
-    }
-  }
-
-  // merge in the rc file
-  style.merge(config->file(), True);
-
-  string s;
-
-  // load fonts/fontsets
-  if (resource.wstyle.font)
-    delete resource.wstyle.font;
-
-  resource.wstyle.font = readDatabaseFont("window.", style);
-
-  // load window config
-  resource.wstyle.t_focus =
-    readDatabaseTexture("window.title.focus", "white", style);
-  resource.wstyle.t_unfocus =
-    readDatabaseTexture("window.title.unfocus", "black", style);
-  resource.wstyle.l_focus =
-    readDatabaseTexture("window.label.focus", "white", style);
-  resource.wstyle.l_unfocus =
-    readDatabaseTexture("window.label.unfocus", "black", style);
-  resource.wstyle.h_focus =
-    readDatabaseTexture("window.handle.focus", "white", style);
-  resource.wstyle.h_unfocus =
-    readDatabaseTexture("window.handle.unfocus", "black", style);
-  resource.wstyle.g_focus =
-    readDatabaseTexture("window.grip.focus", "white", style);
-  resource.wstyle.g_unfocus =
-    readDatabaseTexture("window.grip.unfocus", "black", style);
-  resource.wstyle.b_focus =
-    readDatabaseTexture("window.button.focus", "white", style);
-  resource.wstyle.b_unfocus =
-    readDatabaseTexture("window.button.unfocus", "black", style);
-  resource.wstyle.b_pressed =
-    readDatabaseTexture("window.button.pressed", "black", style);
-
-  //if neither of these can be found, we will use the previous resource
-  resource.wstyle.b_pressed_focus =
-    readDatabaseTexture("window.button.pressed.focus", "black", style, true);
-  resource.wstyle.b_pressed_unfocus =
-    readDatabaseTexture("window.button.pressed.unfocus", "black", style, true);
-
-  if (resource.wstyle.close_button.mask != None)
-    XFreePixmap(otk::OBDisplay::display, resource.wstyle.close_button.mask);
-  if (resource.wstyle.max_button.mask != None)
-    XFreePixmap(otk::OBDisplay::display, resource.wstyle.max_button.mask);
-  if (resource.wstyle.icon_button.mask != None)
-    XFreePixmap(otk::OBDisplay::display, resource.wstyle.icon_button.mask);
-  if (resource.wstyle.stick_button.mask != None)
-    XFreePixmap(otk::OBDisplay::display, resource.wstyle.stick_button.mask);
-
-  resource.wstyle.close_button.mask = resource.wstyle.max_button.mask =
-    resource.wstyle.icon_button.mask =
-    resource.wstyle.icon_button.mask = None;
-  
-  readDatabaseMask("window.button.close.mask", resource.wstyle.close_button,
-                   style);
-  readDatabaseMask("window.button.max.mask", resource.wstyle.max_button,
-                   style);
-  readDatabaseMask("window.button.icon.mask", resource.wstyle.icon_button,
-                   style);
-  readDatabaseMask("window.button.stick.mask", resource.wstyle.stick_button,
-                   style);
-
-  // we create the window.frame texture by hand because it exists only to
-  // make the code cleaner and is not actually used for display
-  otk::BColor color = readDatabaseColor("window.frame.focusColor", "white",
-                                        style);
-  resource.wstyle.f_focus = otk::BTexture("solid flat", getScreenNumber(),
-                                          image_control);
-  resource.wstyle.f_focus.setColor(color);
-
-  color = readDatabaseColor("window.frame.unfocusColor", "white", style);
-  resource.wstyle.f_unfocus = otk::BTexture("solid flat", getScreenNumber(),
-                                            image_control);
-  resource.wstyle.f_unfocus.setColor(color);
-
-  resource.wstyle.l_text_focus =
-    readDatabaseColor("window.label.focus.textColor", "black", style);
-  resource.wstyle.l_text_unfocus =
-    readDatabaseColor("window.label.unfocus.textColor", "white", style);
-  resource.wstyle.b_pic_focus =
-    readDatabaseColor("window.button.focus.picColor", "black", style);
-  resource.wstyle.b_pic_unfocus =
-    readDatabaseColor("window.button.unfocus.picColor", "white", style);
-
-  resource.wstyle.justify = LeftJustify;
-  if (style.getValue("window.justify", s)) {
-    if (s == "right" || s == "Right")
-      resource.wstyle.justify = RightJustify;
-    else if (s == "center" || s == "Center")
-      resource.wstyle.justify = CenterJustify;
-  }
-
-  // sanity checks
-  if (resource.wstyle.t_focus.texture() == otk::BTexture::Parent_Relative)
-    resource.wstyle.t_focus = resource.wstyle.f_focus;
-  if (resource.wstyle.t_unfocus.texture() == otk::BTexture::Parent_Relative)
-    resource.wstyle.t_unfocus = resource.wstyle.f_unfocus;
-  if (resource.wstyle.h_focus.texture() == otk::BTexture::Parent_Relative)
-    resource.wstyle.h_focus = resource.wstyle.f_focus;
-  if (resource.wstyle.h_unfocus.texture() == otk::BTexture::Parent_Relative)
-    resource.wstyle.h_unfocus = resource.wstyle.f_unfocus;
-
-  resource.border_color =
-    readDatabaseColor("borderColor", "black", style);
-
-  // load bevel, border and handle widths
-  if (! style.getValue("handleWidth", resource.handle_width) ||
-      resource.handle_width > (getWidth() / 2) || resource.handle_width == 0)
-    resource.handle_width = 6;
-
-  if (! style.getValue("borderWidth", resource.border_width))
-    resource.border_width = 1;
-
-  if (! style.getValue("bevelWidth", resource.bevel_width) ||
-      resource.bevel_width > (getWidth() / 2) || resource.bevel_width == 0)
-    resource.bevel_width = 3;
-
-  if (! style.getValue("frameWidth", resource.frame_width) ||
-      resource.frame_width > (getWidth() / 2))
-    resource.frame_width = resource.bevel_width;
-
-  if (style.getValue("rootCommand", s))
-    bexec(s, displayString());
-}
-
 
 void BScreen::addIcon(BlackboxWindow *w) {
   if (! w) return;
 
-  w->setWorkspace(BSENTINEL);
+  w->setWorkspace(otk::BSENTINEL);
   w->setWindowNumber(iconList.size());
 
   iconList.push_back(w);
@@ -1014,8 +888,8 @@ void BScreen::changeWorkspaceID(unsigned int id) {
 
   current_workspace = getWorkspace(id);
 
-  xatom->setValue(getRootWindow(), XAtom::net_current_desktop,
-                  XAtom::cardinal, id);
+  xatom->set(getRootWindow(), otk::OBProperty::net_current_desktop,
+             otk::OBProperty::Atom_Cardinal, id);
 
   current_workspace->showAll();
 
@@ -1069,12 +943,12 @@ void BScreen::updateClientList(void) {
     const BlackboxWindowList::iterator end = windowList.end();
     for (; it != end; ++it, ++win_it)
       *win_it = (*it)->getClientWindow();
-    xatom->setValue(getRootWindow(), XAtom::net_client_list, XAtom::window,
-                    windows, windowList.size());
+    xatom->set(getRootWindow(), otk::OBProperty::net_client_list,
+               otk::OBProperty::Atom_Window, windows, windowList.size());
     delete [] windows;
   } else
-    xatom->setValue(getRootWindow(), XAtom::net_client_list, XAtom::window,
-                    0, 0);
+    xatom->set(getRootWindow(), otk::OBProperty::net_client_list,
+               otk::OBProperty::Atom_Window, 0, 0);
 
   updateStackingList();
 }
@@ -1106,12 +980,12 @@ void BScreen::updateStackingList(void) {
                                  end = stack_order.end();
     for (; it != end; ++it, ++win_it)
       *win_it = (*it)->getClientWindow();
-    xatom->setValue(getRootWindow(), XAtom::net_client_list_stacking,
-                    XAtom::window, windows, stack_order.size());
+    xatom->set(getRootWindow(), otk::OBProperty::net_client_list_stacking,
+               otk::OBProperty::Atom_Window, windows, stack_order.size());
     delete [] windows;
   } else
-    xatom->setValue(getRootWindow(), XAtom::net_client_list_stacking,
-                    XAtom::window, 0, 0);
+    xatom->set(getRootWindow(), otk::OBProperty::net_client_list_stacking,
+               otk::OBProperty::Atom_Window, 0, 0);
 }
 
 
@@ -1120,9 +994,9 @@ void BScreen::addSystrayWindow(Window window) {
   
   XSelectInput(otk::OBDisplay::display, window, StructureNotifyMask);
   systrayWindowList.push_back(window);
-  xatom->setValue(getRootWindow(), XAtom::kde_net_system_tray_windows,
-                  XAtom::window,
-                  &systrayWindowList[0], systrayWindowList.size());
+  xatom->set(getRootWindow(), otk::OBProperty::kde_net_system_tray_windows,
+             otk::OBProperty::Atom_Window,
+             &systrayWindowList[0], systrayWindowList.size());
   blackbox->saveSystrayWindowSearch(window, this);
 
   XUngrabServer(otk::OBDisplay::display);
@@ -1137,9 +1011,10 @@ void BScreen::removeSystrayWindow(Window window) {
   for (; it != end; ++it)
     if (*it == window) {
       systrayWindowList.erase(it);
-      xatom->setValue(getRootWindow(), XAtom::kde_net_system_tray_windows,
-                      XAtom::window,
-                      &systrayWindowList[0], systrayWindowList.size());
+      xatom->set(getRootWindow(),
+                 otk::OBProperty::kde_net_system_tray_windows,
+                 otk::OBProperty::Atom_Window,
+                 &systrayWindowList[0], systrayWindowList.size());
       blackbox->removeSystrayWindowSearch(window);
       XSelectInput(otk::OBDisplay::display, window, NoEventMask);
       break;
@@ -1154,8 +1029,10 @@ void BScreen::removeSystrayWindow(Window window) {
 void BScreen::manageWindow(Window w) {
   // is the window a KDE systray window?
   Window systray;
-  if (xatom->getValue(w, XAtom::kde_net_wm_system_tray_window_for,
-                      XAtom::window, systray) && systray != None) {
+  if (xatom->get(w, otk::OBProperty::kde_net_wm_system_tray_window_for,
+                 otk::OBProperty::Atom_Window, &systray) &&
+      systray != None)
+  {
     addSystrayWindow(w);
     return;
   }
@@ -1197,9 +1074,11 @@ void BScreen::manageWindow(Window w) {
 void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
   // is the window a KDE systray window?
   Window systray;
-  if (xatom->getValue(w->getClientWindow(),
-                      XAtom::kde_net_wm_system_tray_window_for,
-                      XAtom::window, systray) && systray != None) {
+  if (xatom->get(w->getClientWindow(),
+                 otk::OBProperty::kde_net_wm_system_tray_window_for,
+                 otk::OBProperty::Atom_Window, &systray) &&
+      systray != None)
+  {
     removeSystrayWindow(w->getClientWindow());
     return;
   }
@@ -1209,8 +1088,8 @@ void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
   // Remove the modality so that its parent won't try to re-focus the window
   if (w->isModal()) w->setModal(False);
   
-  if (w->getWorkspaceNumber() != BSENTINEL &&
-      w->getWindowNumber() != BSENTINEL) {
+  if (w->getWorkspaceNumber() != otk::BSENTINEL &&
+      w->getWindowNumber() != otk::BSENTINEL) {
     getWorkspace(w->getWorkspaceNumber())->removeWindow(w);
     if (w->isStuck()) {
       for (unsigned int i = 0; i < getNumberOfWorkspaces(); ++i)
@@ -1271,18 +1150,19 @@ void BScreen::updateWorkArea(void) {
       dims[(i * 4) + 2] = area.width();
       dims[(i * 4) + 3] = area.height();
     }
-    xatom->setValue(getRootWindow(), XAtom::net_workarea, XAtom::cardinal,
-                    dims, 4 * workspacesList.size());
+    xatom->set(getRootWindow(), otk::OBProperty::net_workarea,
+               otk::OBProperty::Atom_Cardinal,
+               dims, 4 * workspacesList.size());
     delete [] dims;
   } else
-    xatom->setValue(getRootWindow(), XAtom::net_workarea, XAtom::cardinal,
-                    0, 0);
+    xatom->set(getRootWindow(), otk::OBProperty::net_workarea,
+               otk::OBProperty::Atom_Cardinal, 0, 0);
 }
 
 
 void BScreen::updateNetizenWorkspaceCount(void) {
-  xatom->setValue(getRootWindow(), XAtom::net_number_of_desktops,
-                  XAtom::cardinal, workspacesList.size());
+  xatom->set(getRootWindow(), otk::OBProperty::net_number_of_desktops,
+             otk::OBProperty::Atom_Cardinal, workspacesList.size());
 
   updateWorkArea();
 }
@@ -1292,8 +1172,8 @@ void BScreen::updateNetizenWindowFocus(void) {
   Window f = ((blackbox->getFocusedWindow()) ?
               blackbox->getFocusedWindow()->getClientWindow() : None);
 
-  xatom->setValue(getRootWindow(), XAtom::net_active_window,
-                  XAtom::window, f);
+  xatom->set(getRootWindow(), otk::OBProperty::net_active_window,
+             otk::OBProperty::Atom_Window, f);
 }
 
 
@@ -1351,7 +1231,7 @@ void BScreen::reassociateWindow(BlackboxWindow *w, unsigned int wkspc_id,
                                 bool ignore_sticky) {
   if (! w) return;
 
-  if (wkspc_id == BSENTINEL)
+  if (wkspc_id == otk::BSENTINEL)
     wkspc_id = current_workspace->getID();
 
   if (w->getWorkspaceNumber() == wkspc_id)
@@ -1476,7 +1356,7 @@ void BScreen::showPosition(int x, int y) {
   XClearWindow(otk::OBDisplay::display, geom_window);
 
   resource.wstyle.font->drawString(geom_window,
-                                   resource.bevel_width, resource.bevel_width,
+                                   resource.wstyle.bevel_width, resource.wstyle.bevel_width,
                                    resource.wstyle.l_text_focus,
                                    label);
 }
@@ -1500,7 +1380,7 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) {
   XClearWindow(otk::OBDisplay::display, geom_window);
 
   resource.wstyle.font->drawString(geom_window,
-                                   resource.bevel_width, resource.bevel_width,
+                                   resource.wstyle.bevel_width, resource.wstyle.bevel_width,
                                    resource.wstyle.l_text_focus,
                                    label);
 }
@@ -1514,12 +1394,12 @@ void BScreen::hideGeometry(void) {
 }
 
 
-void BScreen::addStrut(Strut *strut) {
+void BScreen::addStrut(otk::Strut *strut) {
   strutList.push_back(strut);
 }
 
 
-void BScreen::removeStrut(Strut *strut) {
+void BScreen::removeStrut(otk::Strut *strut) {
   strutList.remove(strut);
 }
 
@@ -1564,7 +1444,7 @@ void BScreen::updateAvailableArea(void) {
   StrutList::const_iterator it = strutList.begin(), end = strutList.end();
 
   for(; it != end; ++it) {
-    Strut *strut = *it;
+    otk::Strut *strut = *it;
     if (strut->left > current_left)
       current_left = strut->left;
     if (strut->top > current_top)
@@ -1641,7 +1521,7 @@ void BScreen::buttonPressEvent(const XButtonEvent *xbutton) {
 
 
 void BScreen::propertyNotifyEvent(const XPropertyEvent *pe) {
-  if (pe->atom == xatom->getAtom(XAtom::net_desktop_names)) {
+  if (pe->atom == xatom->atom(otk::OBProperty::net_desktop_names)) {
     // _NET_WM_DESKTOP_NAMES
     WorkspaceList::iterator it = workspacesList.begin();
     const WorkspaceList::iterator end = workspacesList.end();
@@ -1672,122 +1552,4 @@ void BScreen::toggleFocusModel(FocusModel model) {
                 std::mem_fun(&BlackboxWindow::grabButtons));
 }
 
-void BScreen::readDatabaseMask(const string &rname, PixmapMask &pixmapMask,
-                               const Configuration &style) {
-  string s;
-  int hx, hy; //ignored
-  int ret = BitmapOpenFailed; //default to failure.
-  
-  if (style.getValue(rname, s))
-  {
-    if (s[0] != '/' && s[0] != '~')
-    {
-      std::string xbmFile = std::string("~/.openbox/buttons/") + s;
-      ret = XReadBitmapFile(otk::OBDisplay::display, getRootWindow(),
-                            expandTilde(xbmFile).c_str(), &pixmapMask.w,
-                            &pixmapMask.h, &pixmapMask.mask, &hx, &hy);
-    } else
-      ret = XReadBitmapFile(otk::OBDisplay::display, getRootWindow(),
-                            expandTilde(s).c_str(), &pixmapMask.w,
-                            &pixmapMask.h, &pixmapMask.mask, &hx, &hy);
-    
-    if (ret == BitmapSuccess)
-      return;
-  }
-
-  pixmapMask.mask = None;
-  pixmapMask.w = pixmapMask.h = 0;
-}
-
-otk::BTexture BScreen::readDatabaseTexture(const string &rname,
-                                           const string &default_color,
-                                           const Configuration &style, 
-                                           bool allowNoTexture) {
-  otk::BTexture texture;
-  string s;
-
-  if (style.getValue(rname, s))
-    texture = otk::BTexture(s);
-  else if (allowNoTexture) //no default
-    texture.setTexture(otk::BTexture::NoTexture);
-  else
-    texture.setTexture(otk::BTexture::Solid | otk::BTexture::Flat);
-
-  // associate this texture with this screen
-  texture.setScreen(getScreenNumber());
-  texture.setImageControl(image_control);
-
-  if (texture.texture() != otk::BTexture::NoTexture) {
-    texture.setColor(readDatabaseColor(rname + ".color", default_color,
-                                       style));
-    texture.setColorTo(readDatabaseColor(rname + ".colorTo", default_color,
-                                         style));
-    texture.setBorderColor(readDatabaseColor(rname + ".borderColor",
-                                             default_color, style));
-  }
-
-  return texture;
-}
-
-
-otk::BColor BScreen::readDatabaseColor(const string &rname,
-                                       const string &default_color,
-                                       const Configuration &style) {
-  otk::BColor color;
-  string s;
-  if (style.getValue(rname, s))
-    color = otk::BColor(s, getScreenNumber());
-  else
-    color = otk::BColor(default_color, getScreenNumber());
-  return color;
-}
-
-
-otk::BFont *BScreen::readDatabaseFont(const string &rbasename,
-                                      const Configuration &style) {
-  string fontname;
-
-  string s;
-
-  int i;
-  if (style.getValue(rbasename + "xft.font", s) &&
-      style.getValue(rbasename + "xft.size", i)) {
-    string family = s;
-    bool bold = False;
-    bool italic = False;
-    bool dropShadow = False;
-
-    if (style.getValue(rbasename + "xft.flags", s)) {
-      if (s.find("bold") != string::npos)
-        bold = True;
-      if (s.find("italic") != string::npos)
-        italic = True;
-      if (s.find("shadow") != string::npos)
-        dropShadow = True;
-    }
-    
-    unsigned char offset = 1;
-    if (style.getValue(rbasename + "xft.shadow.offset", s)) {
-      offset = atoi(s.c_str()); //doesn't detect errors
-      if (offset > CHAR_MAX)
-        offset = 1;
-    }
-
-    unsigned char tint = 0x40;
-    if (style.getValue(rbasename + "xft.shadow.tint", s)) {
-      tint = atoi(s.c_str());
-    }
-
-    
-    otk::BFont *b = new otk::BFont(getScreenNumber(), family, i, bold, italic,
-                                   dropShadow && resource.shadow_fonts,
-                                   offset, tint, resource.aa_fonts);
-    if (b->valid())
-      return b;
-    delete b;
-  }
-    
-  exit(2);  // can't continue without a font
-}
-
 }
This page took 0.043947 seconds and 4 git commands to generate.