From f8f2b874a7411280d9e4179d140cecb7a261231f Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 8 Jan 2002 00:12:51 +0000 Subject: Removed Fluxbox dependency --- src/Theme.cc | 86 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/src/Theme.cc b/src/Theme.cc index c57c850..4caa734 100644 --- a/src/Theme.cc +++ b/src/Theme.cc @@ -41,6 +41,8 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +// $Id: Theme.cc,v 1.8 2002/01/08 00:12:51 fluxgen Exp $ + #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE @@ -49,31 +51,35 @@ # include "config.h" #endif //HAVE_CONFIG_H_ -#ifdef HAVE_CTYPE_H -# include -#endif // HAVE_CTYPE_H - #include "Theme.hh" + #include "i18n.hh" #include "Basemenu.hh" -#include "fluxbox.hh" #include "StringUtil.hh" #include -#include -#include -#include -#ifndef FONT_ELEMENT_SIZE -# define FONT_ELEMENT_SIZE 50 -#endif // FONT_ELEMENT_SIZE +#ifdef HAVE_CTYPE_H +# include +#endif // HAVE_CTYPE_H -Theme::Theme(Display *display, Window rootwindow, Colormap colormap, int screennum, BImageControl *ic, const char *filename) { +#include +#include +#include +#include +#include +using namespace std; + + +Theme::Theme(Display *display, Window rootwindow, Colormap colormap, + int screennum, BImageControl *ic, const char *filename, const char *rootcommand): +m_imagecontrol(ic), +m_display(display), +m_colormap(colormap), +m_screennum(screennum), +m_rootcommand(rootcommand) +{ - m_screennum = screennum; - m_display = display; - m_imagecontrol = ic; - m_colormap = colormap; //default settings m_menustyle.titlefont.set = m_menustyle.framefont.set = m_toolbarstyle.font.set = m_windowstyle.font.set = m_windowstyle.tab.font.set = 0; @@ -285,7 +291,7 @@ void Theme::freeToolbarStyle() { //---------- load ------------ // Loads a theme from a file //---------------------------- -void Theme::load(const char *filename) { +void Theme::load(const char *filename){ m_database = XrmGetFileDatabase(filename); if (!m_database) m_database = XrmGetFileDatabase(DEFAULTSTYLE); @@ -648,39 +654,42 @@ void Theme::loadToolbarStyle() { void Theme::loadRootCommand() { XrmValue value; char *value_type; - Fluxbox *fb=Fluxbox::instance(); - const char *root_cmd=fb->getRootCommand(); - - if (root_cmd) { + if (m_rootcommand.size()) { #ifndef __EMX__ - const int display_strlen = 1024; - char displaystring[display_strlen]; - snprintf(displaystring, display_strlen, "DISPLAY=%s%d", - DisplayString(m_display), m_screennum); + //const int display_strlen = 1024; + //char displaystring[display_strlen]; + strstream displaystring; + displaystring<<"DISPLAY="<