all repos — fluxbox @ 5ebc789e880c96f0c72a0a5f03b71ca867b65f11

custom fork of the fluxbox windowmanager

changed toolbar, so it uses fbtk font
fluxgen fluxgen
commit

5ebc789e880c96f0c72a0a5f03b71ca867b65f11

parent

1c4b2d2f8bc0d018cb8380a917d972be5148ec44

2 files changed, 19 insertions(+), 45 deletions(-)

jump to
M src/Theme.ccsrc/Theme.cc

@@ -21,7 +21,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Theme.cc,v 1.31 2002/10/15 17:08:45 fluxgen Exp $ +// $Id: Theme.cc,v 1.32 2002/10/29 16:07:27 fluxgen Exp $ #ifndef _GNU_SOURCE #define _GNU_SOURCE

@@ -62,9 +62,6 @@ cerr<<__FILE__<<"("<<__LINE__<<"): Creating."<<endl;

#endif //DEBUG //default settings - m_toolbarstyle.font.set = 0; - m_toolbarstyle.font.fontstruct = 0; - load(filename); //-------- create gc for the styles ------------

@@ -114,15 +111,12 @@ XCreateGC(m_display, rootwindow,

GCForeground, &gcv); gcv.foreground = m_menustyle.t_text.pixel(); - //if (m_menustyle.titlefont.fontStruct()) - // gcv.font = m_menustyle.titlefont.fontStruct()->fid; + m_menustyle.t_text_gc = XCreateGC(m_display, rootwindow, gc_value_mask, &gcv); gcv.foreground = m_menustyle.f_text.pixel(); - //if (m_menustyle.framefont.fontStruct()) - // gcv.font = m_menustyle.framefont.fontStruct()->fid; m_menustyle.f_text_gc = XCreateGC(m_display, rootwindow,

@@ -144,8 +138,7 @@ XCreateGC(m_display, rootwindow,

gc_value_mask, &gcv); gcv.foreground = m_toolbarstyle.l_text.pixel(); - if (m_toolbarstyle.font.fontstruct) - gcv.font = m_toolbarstyle.font.fontstruct->fid; + m_toolbarstyle.l_text_gc = XCreateGC(m_display, rootwindow, gc_value_mask, &gcv);

@@ -212,12 +205,6 @@ // should only be called from ~Theme

//-------------------- void Theme::freeToolbarStyle() { - if (m_toolbarstyle.font.set) - XFreeFontSet(m_display, m_toolbarstyle.font.set); - - if (m_toolbarstyle.font.fontstruct) - XFreeFont(m_display, m_toolbarstyle.font.fontstruct); - XFreeGC(m_display, m_toolbarstyle.l_text_gc); XFreeGC(m_display, m_toolbarstyle.w_text_gc); XFreeGC(m_display, m_toolbarstyle.c_text_gc);

@@ -546,29 +533,21 @@

// ----------- load font - if (I18n::instance()->multibyte()) { - readDatabaseFontSet("toolbar.font", "Toolbar.Font", - &m_toolbarstyle.font.set); - - m_toolbarstyle.font.set_extents = - XExtentsOfFontSet(m_toolbarstyle.font.set); - } else { - readDatabaseFont("toolbar.font", "Toolbar.Font", - &m_toolbarstyle.font.fontstruct); - } + loadFontFromDatabase(m_toolbarstyle.font, "toolbar.font", "Toolbar.Font"); + XrmValue value; char *value_type; if (XrmGetResource(m_database, "toolbar.justify", "Toolbar.Justify", &value_type, &value)) { if (strstr(value.addr, "right") || strstr(value.addr, "Right")) - m_toolbarstyle.font.justify = DrawUtil::Font::RIGHT; + m_toolbarstyle.justify = DrawUtil::Font::RIGHT; else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) - m_toolbarstyle.font.justify = DrawUtil::Font::CENTER; + m_toolbarstyle.justify = DrawUtil::Font::CENTER; else - m_toolbarstyle.font.justify = DrawUtil::Font::LEFT; + m_toolbarstyle.justify = DrawUtil::Font::LEFT; } else - m_toolbarstyle.font.justify = DrawUtil::Font::LEFT; + m_toolbarstyle.justify = DrawUtil::Font::LEFT; }

@@ -577,7 +556,7 @@ XrmValue value;

char *value_type; if (m_rootcommand.size()) { - #ifndef __EMX__ +#ifndef __EMX__ char tmpstring[256]; //to hold m_screennum tmpstring[0]=0; sprintf(tmpstring, "%d", m_screennum);

@@ -587,13 +566,13 @@ displaystring.append(tmpstring); // append m_screennum

bexec(m_rootcommand.c_str(), const_cast<char *>(displaystring.c_str())); - #else // __EMX__ +#else // __EMX__ spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", m_rootcommand.c_str(), 0); - #endif // !__EMX__ +#endif // !__EMX__ } else if (XrmGetResource(m_database, "rootCommand", "RootCommand", &value_type, &value)) { - #ifndef __EMX__ +#ifndef __EMX__ char tmpstring[256]; //to hold m_screennum tmpstring[0]=0; sprintf(tmpstring, "%d", m_screennum);

@@ -602,11 +581,9 @@ displaystring.append(DisplayString(m_display));

displaystring.append(tmpstring); // append m_screennum bexec(value.addr, const_cast<char *>(displaystring.c_str())); - #else // __EMX__ - +#else // __EMX__ spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", value.addr, 0); - - #endif // !__EMX__ +#endif // !__EMX__ } #ifdef DEBUG

@@ -937,10 +914,6 @@

gcv.foreground = m_menustyle.hilite.color().pixel(); XChangeGC(m_display, m_menustyle.hilite_gc, gc_value_mask, &gcv); - - gcv.foreground = m_toolbarstyle.l_text.pixel(); - if (m_toolbarstyle.font.fontstruct) - gcv.font = m_toolbarstyle.font.fontstruct->fid; gc_value_mask |= GCFont; XChangeGC(m_display, m_toolbarstyle.l_text_gc,
M src/Theme.hhsrc/Theme.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Theme.hh,v 1.16 2002/10/15 17:07:32 fluxgen Exp $ +// $Id: Theme.hh,v 1.17 2002/10/29 16:06:23 fluxgen Exp $ #ifndef THEME_HH #define THEME_HH

@@ -89,11 +89,12 @@ } WindowStyle;

typedef struct ToolbarStyle { + ToolbarStyle():font("fixed") { } // default font 'fixed' FbTk::Color l_text, w_text, c_text, b_pic; FbTk::Texture toolbar, label, window, button, pressed, clock; GC l_text_gc, w_text_gc, c_text_gc, b_pic_gc; - DrawUtil::Font font; - + FbTk::Font font; + DrawUtil::Font::FontJustify justify; } ToolbarStyle; inline WindowStyle &getWindowStyle() { return m_windowstyle; }